Skip to content

Commit

Permalink
chore: cs & sa
Browse files Browse the repository at this point in the history
  • Loading branch information
apple-x-co committed Jul 24, 2024
1 parent 9156cce commit 171f238
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions source/app/src/Form/ExtendedForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,15 @@ public function widget(string $name, array $attr = []): string

return (string) $this->helper->input($array); // @phpstan-ignore-line
}

/**
* @return list<string>
*
* @psalm-suppress MoreSpecificReturnType
* @psalm-suppress LessSpecificReturnStatement
*/
public function errorMessages(string|null $name): array
{
return $this->getMessages($name);
}
}
4 changes: 2 additions & 2 deletions source/app/var/qiq/template/Admin/#.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ function cfTurnstileTimeout() {
{{ endif }}

{{= $form->widget('username', attr: ['class' => 'abc']) }}
{{ foreach ($form->getMessages('username') as $errorMessage): }}
{{ foreach ($form->errorMessages('username') as $errorMessage): }}
<p>{{h $errorMessage }}</p>
{{ endforeach; }}

{{= $form->widget('password', attr: ['class' => 'abc']) }}
{{ foreach ($form->getMessages('password') as $errorMessage): }}
{{ foreach ($form->errorMessages('password') as $errorMessage): }}
<p>{{h $errorMessage }}</p>
{{ endforeach; }}

Expand Down

0 comments on commit 171f238

Please # to comment.