add phpstan and fix some errors
continuous-integration/drone/push Build is passing Details

pull/13/head
maxime.batista 1 year ago
parent 4aa2bde233
commit 2ce537b2b4

@ -9,6 +9,7 @@
"ext-json": "*", "ext-json": "*",
"ext-pdo": "*", "ext-pdo": "*",
"ext-pdo_sqlite": "*", "ext-pdo_sqlite": "*",
"twig/twig":"^2.0" "twig/twig":"^2.0",
"phpstan/phpstan": "*"
} }
} }

@ -29,7 +29,7 @@ class APITacticController {
], function (HttpRequest $request) use ($tactic_id) { ], function (HttpRequest $request) use ($tactic_id) {
$this->model->updateName($tactic_id, $request["name"]); $this->model->updateName($tactic_id, $request["name"]);
return HttpResponse::fromCode(HttpCodes::OK); return HttpResponse::fromCode(HttpCodes::OK);
}); }, true);
} }
public function newTactic(): HttpResponse { public function newTactic(): HttpResponse {
@ -39,7 +39,7 @@ class APITacticController {
$tactic = $this->model->makeNew($request["name"]); $tactic = $this->model->makeNew($request["name"]);
$id = $tactic->getId(); $id = $tactic->getId();
return new JsonHttpResponse(["id" => $id]); return new JsonHttpResponse(["id" => $id]);
}); }, true);
} }
public function getTacticInfo(int $id): HttpResponse { public function getTacticInfo(int $id): HttpResponse {

Loading…
Cancel
Save