style: auto-fix 1340 phpcs PSR-12 violations via phpcbf; exclude MissingNamespace and SideEffects
Lint / PHP (phpcs PSR-12) (push) Failing after 29s
Lint / JS (eslint) (push) Successful in 12s

This commit is contained in:
2026-04-13 20:56:10 -04:00
parent b6df647921
commit c90bdc8ac8
80 changed files with 1674 additions and 1092 deletions
+16 -11
View File
@@ -1,23 +1,28 @@
<?php
require_once 'models/CommentModel.php';
class CommentController {
class CommentController
{
private $commentModel;
public function __construct($conn) {
public function __construct($conn)
{
$this->commentModel = new CommentModel($conn);
}
public function getCommentsByTicketId($ticketId) {
public function getCommentsByTicketId($ticketId)
{
return $this->commentModel->getCommentsByTicketId($ticketId);
}
public function addComment($ticketId) {
public function addComment($ticketId)
{
// Check if this is an AJAX request
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// Get JSON data
$data = json_decode(file_get_contents('php://input'), true);
// Validate input
if (empty($data['comment_text'])) {
header('Content-Type: application/json');
@@ -27,10 +32,10 @@ class CommentController {
]);
return;
}
// Add comment
$result = $this->commentModel->addComment($ticketId, $data);
// Return JSON response
header('Content-Type: application/json');
echo json_encode($result);
@@ -40,4 +45,4 @@ class CommentController {
exit;
}
}
}
}