Skip to content

Commit

Permalink
Second pass of pass of level 4 psalm check
Browse files Browse the repository at this point in the history
  • Loading branch information
townxelliot committed Jun 8, 2022
1 parent 285d50a commit 345c244
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion service-admin/src/App/src/Form/Fieldset/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, mixed>
*/
public function getMessages($elementName = null): array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion service-admin/src/App/src/Handler/Traits/JwtTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}
Expand Down
4 changes: 1 addition & 3 deletions service-admin/src/App/src/Handler/UserFindHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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, [
Expand Down
5 changes: 1 addition & 4 deletions service-admin/src/App/src/Handler/UserSearchHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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, [
Expand Down

0 comments on commit 345c244

Please sign in to comment.