From 2ce537b2b4bfab803b80e2d64db660d8040261a1 Mon Sep 17 00:00:00 2001 From: "maxime.batista" Date: Wed, 15 Nov 2023 14:26:26 +0100 Subject: [PATCH] add phpstan and fix some errors --- composer.json | 3 ++- src/Controller/Api/APITacticController.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index c78fb15..e5b80e0 100644 --- a/composer.json +++ b/composer.json @@ -9,6 +9,7 @@ "ext-json": "*", "ext-pdo": "*", "ext-pdo_sqlite": "*", - "twig/twig":"^2.0" + "twig/twig":"^2.0", + "phpstan/phpstan": "*" } } \ No newline at end of file diff --git a/src/Controller/Api/APITacticController.php b/src/Controller/Api/APITacticController.php index f775ecf..a39b2ce 100644 --- a/src/Controller/Api/APITacticController.php +++ b/src/Controller/Api/APITacticController.php @@ -29,7 +29,7 @@ class APITacticController { ], function (HttpRequest $request) use ($tactic_id) { $this->model->updateName($tactic_id, $request["name"]); return HttpResponse::fromCode(HttpCodes::OK); - }); + }, true); } public function newTactic(): HttpResponse { @@ -39,7 +39,7 @@ class APITacticController { $tactic = $this->model->makeNew($request["name"]); $id = $tactic->getId(); return new JsonHttpResponse(["id" => $id]); - }); + }, true); } public function getTacticInfo(int $id): HttpResponse {