diff --git a/src/Controller/Note/Delete.php b/src/Controller/Note/Delete.php index 07517062..7074383e 100644 --- a/src/Controller/Note/Delete.php +++ b/src/Controller/Note/Delete.php @@ -9,8 +9,11 @@ final class Delete extends Base { - public function __invoke(Request $request, Response $response, array $args): Response - { + public function __invoke( + Request $request, + Response $response, + array $args + ): Response { $this->getServiceDeleteNote()->delete((int) $args['id']); return $this->jsonResponse($response, 'success', null, 204); diff --git a/src/Controller/Note/GetAll.php b/src/Controller/Note/GetAll.php index e9eb19f2..1e6e2afc 100644 --- a/src/Controller/Note/GetAll.php +++ b/src/Controller/Note/GetAll.php @@ -9,8 +9,11 @@ final class GetAll extends Base { - public function __invoke(Request $request, Response $response): Response - { + public function __invoke( + Request $request, + Response $response, + array $args + ): Response { $page = $request->getQueryParam('page', null); $perPage = $request->getQueryParam('perPage', self::DEFAULT_PER_PAGE_PAGINATION); diff --git a/src/Controller/Note/GetOne.php b/src/Controller/Note/GetOne.php index 2f9d24aa..adae2aac 100644 --- a/src/Controller/Note/GetOne.php +++ b/src/Controller/Note/GetOne.php @@ -9,8 +9,11 @@ final class GetOne extends Base { - public function __invoke(Request $request, Response $response, array $args): Response - { + public function __invoke( + Request $request, + Response $response, + array $args + ): Response { $note = $this->getServiceFindNote()->getOne((int) $args['id']); return $this->jsonResponse($response, 'success', $note, 200); diff --git a/src/Controller/Note/Search.php b/src/Controller/Note/Search.php index 41c3fef1..57400d66 100644 --- a/src/Controller/Note/Search.php +++ b/src/Controller/Note/Search.php @@ -9,8 +9,11 @@ final class Search extends Base { - public function __invoke(Request $request, Response $response, array $args): Response - { + public function __invoke( + Request $request, + Response $response, + array $args + ): Response { $notes = $this->getServiceFindNote()->search($args['query']); return $this->jsonResponse($response, 'success', $notes, 200); diff --git a/src/Controller/Note/Update.php b/src/Controller/Note/Update.php index bacdf500..92c16a3b 100644 --- a/src/Controller/Note/Update.php +++ b/src/Controller/Note/Update.php @@ -9,8 +9,11 @@ final class Update extends Base { - public function __invoke(Request $request, Response $response, array $args): Response - { + public function __invoke( + Request $request, + Response $response, + array $args + ): Response { $input = (array) $request->getParsedBody(); $note = $this->getServiceUpdateNote()->update($input, (int) $args['id']); diff --git a/src/Repository/BaseRepository.php b/src/Repository/BaseRepository.php index 5af15fd1..f2ccd8d2 100644 --- a/src/Repository/BaseRepository.php +++ b/src/Repository/BaseRepository.php @@ -21,7 +21,7 @@ protected function getDb(): \PDO protected function getResultByPage($query, $page, $perPage) { $offset = ($page - 1) * $perPage; - $query = $query . " LIMIT ${perPage} OFFSET ${offset}"; + $query .= " LIMIT ${perPage} OFFSET ${offset}"; $statement = $this->database->prepare($query); $statement->execute();