diff --git a/service-admin/src/App/src/Form/Fieldset/Date.php b/service-admin/src/App/src/Form/Fieldset/Date.php index 6547931f7e..493101d4ee 100644 --- a/service-admin/src/App/src/Form/Fieldset/Date.php +++ b/service-admin/src/App/src/Form/Fieldset/Date.php @@ -94,7 +94,7 @@ public function getInputFilter(): InputFilter /** * Combines the errors from each field into one. * - * @param null $elementName + * @param null|string $elementName * @return array */ public function getMessages($elementName = null): array diff --git a/service-admin/src/App/src/Handler/Initializers/TemplatingSupportTrait.php b/service-admin/src/App/src/Handler/Initializers/TemplatingSupportTrait.php index a7dffccd3c..8f4574b581 100644 --- a/service-admin/src/App/src/Handler/Initializers/TemplatingSupportTrait.php +++ b/service-admin/src/App/src/Handler/Initializers/TemplatingSupportTrait.php @@ -23,9 +23,10 @@ trait TemplatingSupportTrait /** * @param TemplateRendererInterface $render */ - public function setTemplateRenderer(TemplateRendererInterface $render) + public function setTemplateRenderer(TemplateRendererInterface $template) { - $this->render = $render; + $this->render = $template; + return $this; } /** diff --git a/service-admin/src/App/src/Handler/Initializers/UrlHelperTrait.php b/service-admin/src/App/src/Handler/Initializers/UrlHelperTrait.php index 3157e1e2b5..8419af6c32 100644 --- a/service-admin/src/App/src/Handler/Initializers/UrlHelperTrait.php +++ b/service-admin/src/App/src/Handler/Initializers/UrlHelperTrait.php @@ -21,9 +21,10 @@ trait UrlHelperTrait /** * @param UrlHelper $helper */ - public function setUrlHelper(UrlHelper $helper) + public function setUrlHelper(UrlHelper $template) { - $this->helper = $helper; + $this->helper = $template; + return $this; } /** diff --git a/service-admin/src/App/src/Handler/Traits/JwtTrait.php b/service-admin/src/App/src/Handler/Traits/JwtTrait.php index ef5942cf11..1b2331cf3b 100644 --- a/service-admin/src/App/src/Handler/Traits/JwtTrait.php +++ b/service-admin/src/App/src/Handler/Traits/JwtTrait.php @@ -73,7 +73,7 @@ private function clearTokenData(): void */ private function verifyTokenDataExists(): void { - if (!array_key_exists('jwt-payload', $_SESSION)) { + if (!isset($_SESSION['jwt-payload'])) { throw new RuntimeException('JWT token not available'); } } diff --git a/service-admin/src/App/src/Handler/UserFindHandler.php b/service-admin/src/App/src/Handler/UserFindHandler.php index f1c19740fa..bc2355f6d8 100644 --- a/service-admin/src/App/src/Handler/UserFindHandler.php +++ b/service-admin/src/App/src/Handler/UserFindHandler.php @@ -98,10 +98,8 @@ public function handle(ServerRequestInterface $request): ResponseInterface } if ($numResults === 0) { + /** @var array */ $formMessages = $form->getMessages(); - if (!is_array($formMessages)) { - $formMessages = iterator_to_array($formMessages); - } // Set error message $messages = array_merge($formMessages, [ diff --git a/service-admin/src/App/src/Handler/UserSearchHandler.php b/service-admin/src/App/src/Handler/UserSearchHandler.php index b6b82c75b0..b00e208c83 100644 --- a/service-admin/src/App/src/Handler/UserSearchHandler.php +++ b/service-admin/src/App/src/Handler/UserSearchHandler.php @@ -53,11 +53,8 @@ public function handle(ServerRequestInterface $request): ResponseInterface $result = $this->userService->search($email); if ($result === false) { - // Traversable|array + /** @var array */ $formMessages = $form->getMessages(); - if (!is_array($formMessages)) { - $formMessages = iterator_to_array($formMessages); - } // Set error message $messages = array_merge($formMessages, [