From 171f238d2a9e9708e8bbb6476d944d3d4ed16773 Mon Sep 17 00:00:00 2001 From: "Kouhei.Sano" Date: Wed, 24 Jul 2024 11:35:15 +0900 Subject: [PATCH] chore: cs & sa --- source/app/src/Form/ExtendedForm.php | 11 +++++++++++ source/app/var/qiq/template/Admin/Login.php | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/source/app/src/Form/ExtendedForm.php b/source/app/src/Form/ExtendedForm.php index fbb4b36..579d76c 100644 --- a/source/app/src/Form/ExtendedForm.php +++ b/source/app/src/Form/ExtendedForm.php @@ -33,4 +33,15 @@ public function widget(string $name, array $attr = []): string return (string) $this->helper->input($array); // @phpstan-ignore-line } + + /** + * @return list + * + * @psalm-suppress MoreSpecificReturnType + * @psalm-suppress LessSpecificReturnStatement + */ + public function errorMessages(string|null $name): array + { + return $this->getMessages($name); + } } diff --git a/source/app/var/qiq/template/Admin/Login.php b/source/app/var/qiq/template/Admin/Login.php index aab4b91..b53fbcf 100644 --- a/source/app/var/qiq/template/Admin/Login.php +++ b/source/app/var/qiq/template/Admin/Login.php @@ -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): }}

{{h $errorMessage }}

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

{{h $errorMessage }}

{{ endforeach; }}