diff --git a/config/autoload/doctrine.global.php b/config/autoload/doctrine.global.php index 2fd162c5..454a4ad8 100644 --- a/config/autoload/doctrine.global.php +++ b/config/autoload/doctrine.global.php @@ -5,7 +5,6 @@ use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface; use Doctrine\Persistence\Mapping\Driver\MappingDriverChain; -use Frontend\App\Resolver\EntityListenerResolver; use Ramsey\Uuid\Doctrine\UuidBinaryOrderedTimeType; use Ramsey\Uuid\Doctrine\UuidBinaryType; use Ramsey\Uuid\Doctrine\UuidType; @@ -23,7 +22,7 @@ ], ], 'doctrine' => [ - 'connection' => [ + 'connection' => [ 'orm_default' => [ 'doctrine_mapping_types' => [ UuidBinaryType::NAME => 'binary', @@ -31,7 +30,7 @@ ], ], ], - 'driver' => [ + 'driver' => [ // default metadata driver, aggregates all other drivers into a single one. // Override `orm_default` only if you know what you're doing 'orm_default' => [ @@ -39,12 +38,12 @@ 'drivers' => [], ], ], - 'types' => [ + 'types' => [ UuidType::NAME => UuidType::class, UuidBinaryType::NAME => UuidBinaryType::class, UuidBinaryOrderedTimeType::NAME => UuidBinaryOrderedTimeType::class, ], - 'fixtures' => getcwd() . '/data/doctrine/fixtures', + 'fixtures' => getcwd() . '/data/doctrine/fixtures', ], 'resultCacheLifetime' => 600, ]; diff --git a/src/Contact/src/Controller/ContactController.php b/src/Contact/src/Controller/ContactController.php index b85dcfa4..665a3105 100644 --- a/src/Contact/src/Controller/ContactController.php +++ b/src/Contact/src/Controller/ContactController.php @@ -66,10 +66,10 @@ public function formAction(): ResponseInterface $this->messenger->addError('Missing recaptcha'); return new RedirectResponse($request->getUri(), 303); } - $data['subject'] = $data['subject'] ?: $this->config['application']['name'] . ' Contact'; $form->setData($data); if ($form->isValid()) { + /** @var array $dataForm */ $dataForm = $form->getData(); $result = $this->messageService->processMessage($dataForm); diff --git a/src/Contact/src/Form/ContactForm.php b/src/Contact/src/Form/ContactForm.php index 357eb214..3b23b53c 100644 --- a/src/Contact/src/Form/ContactForm.php +++ b/src/Contact/src/Form/ContactForm.php @@ -10,8 +10,10 @@ use Laminas\Form\Element\Text; use Laminas\Form\Element\Textarea; use Laminas\Form\Form; +use Laminas\Form\FormInterface; use Laminas\InputFilter\InputFilterInterface; +/** @template-extends Form */ class ContactForm extends Form { protected InputFilterInterface $inputFilter; diff --git a/src/User/src/Controller/AccountController.php b/src/User/src/Controller/AccountController.php index 49a04f12..ee92f765 100644 --- a/src/User/src/Controller/AccountController.php +++ b/src/User/src/Controller/AccountController.php @@ -134,7 +134,9 @@ public function requestResetPasswordAction(): ResponseInterface return new RedirectResponse($this->getRequest()->getUri(), 303); } - $user = $this->userService->findOneBy(['identity' => $form->getData()['identity']]); + /** @var array $data */ + $data = $form->getData(); + $user = $this->userService->findOneBy(['identity' => $data['identity']]); if (! $user instanceof User) { $this->messenger->addInfo(Message::MAIL_SENT_RESET_PASSWORD, 'request-reset'); return new RedirectResponse($this->getRequest()->getUri()); @@ -201,10 +203,12 @@ public function resetPasswordAction(): ResponseInterface return new RedirectResponse($this->getRequest()->getUri(), 303); } + /** @var array $data */ + $data = $form->getData(); try { $this->userService->updateUser( $resetPasswordRequest->markAsCompleted()->getUser(), - $form->getData() + $data ); $this->debugBar->stackData(); } catch (Exception $exception) { @@ -299,6 +303,7 @@ public function detailsAction(): ResponseInterface if (RequestMethodInterface::METHOD_POST === $this->request->getMethod()) { $form->setData($this->request->getParsedBody()); if ($form->isValid()) { + /** @var array $userData */ $userData = $form->getData(); try { $this->userService->updateUser($user, $userData); @@ -363,6 +368,7 @@ public function changePasswordAction(): ResponseInterface if (RequestMethodInterface::METHOD_POST === $this->request->getMethod()) { $form->setData($this->request->getParsedBody()); if ($form->isValid()) { + /** @var array $userData */ $userData = $form->getData(); try { $this->userService->updateUser($user, $userData); @@ -416,6 +422,7 @@ public function deleteAccountAction(): ResponseInterface if (RequestMethodInterface::METHOD_POST === $this->request->getMethod()) { $form->setData($this->request->getParsedBody()); if ($form->isValid()) { + /** @var array $userData */ $userData = $form->getData(); try { $this->userService->updateUser($user, $userData); diff --git a/src/User/src/Controller/UserController.php b/src/User/src/Controller/UserController.php index 97644cdb..1529cdfb 100644 --- a/src/User/src/Controller/UserController.php +++ b/src/User/src/Controller/UserController.php @@ -76,6 +76,7 @@ public function loginAction(): ResponseInterface if ($form->isValid()) { /** @var AuthenticationAdapter $adapter */ $adapter = $this->authenticationService->getAdapter(); + /** @var array $data */ $data = $form->getData(); $adapter->setIdentity($data['identity'])->setCredential($data['password']); $authResult = $this->authenticationService->authenticate(); @@ -146,6 +147,7 @@ public function registerAction(): ResponseInterface if (RequestMethodInterface::METHOD_POST === $this->getRequest()->getMethod()) { $form->setData($this->getRequest()->getParsedBody()); if ($form->isValid()) { + /** @var array $userData */ $userData = $form->getData(); try { /** @var User $user */ diff --git a/src/User/src/Form/LoginForm.php b/src/User/src/Form/LoginForm.php index 586c0523..9cd22965 100644 --- a/src/User/src/Form/LoginForm.php +++ b/src/User/src/Form/LoginForm.php @@ -9,8 +9,10 @@ use Laminas\Form\Element\Password; use Laminas\Form\Element\Submit; use Laminas\Form\Form; +use Laminas\Form\FormInterface; use Laminas\InputFilter\InputFilterInterface; +/** @template-extends Form */ class LoginForm extends Form { protected InputFilterInterface $inputFilter; diff --git a/src/User/src/Form/ProfileDeleteForm.php b/src/User/src/Form/ProfileDeleteForm.php index 86a500b3..5d059857 100644 --- a/src/User/src/Form/ProfileDeleteForm.php +++ b/src/User/src/Form/ProfileDeleteForm.php @@ -8,8 +8,10 @@ use Frontend\User\InputFilter\ProfileDeleteInputFilter; use Laminas\Form\Element\Submit; use Laminas\Form\Form; +use Laminas\Form\FormInterface; use Laminas\InputFilter\InputFilterInterface; +/** @template-extends Form */ class ProfileDeleteForm extends Form { protected InputFilterInterface $inputFilter; diff --git a/src/User/src/Form/ProfileDetailsForm.php b/src/User/src/Form/ProfileDetailsForm.php index c03037c4..c5cba21e 100644 --- a/src/User/src/Form/ProfileDetailsForm.php +++ b/src/User/src/Form/ProfileDetailsForm.php @@ -8,9 +8,11 @@ use Frontend\User\InputFilter\UserDetailInputFilter; use Laminas\Form\Element\Submit; use Laminas\Form\Form; +use Laminas\Form\FormInterface; use Laminas\InputFilter\InputFilter; use Laminas\InputFilter\InputFilterInterface; +/** @template-extends Form */ class ProfileDetailsForm extends Form { protected InputFilterInterface $inputFilter; diff --git a/src/User/src/Form/ProfilePasswordForm.php b/src/User/src/Form/ProfilePasswordForm.php index 275158b4..b82246a1 100644 --- a/src/User/src/Form/ProfilePasswordForm.php +++ b/src/User/src/Form/ProfilePasswordForm.php @@ -8,8 +8,10 @@ use Laminas\Form\Element\Password; use Laminas\Form\Element\Submit; use Laminas\Form\Form; +use Laminas\Form\FormInterface; use Laminas\InputFilter\InputFilterInterface; +/** @template-extends Form */ class ProfilePasswordForm extends Form { protected InputFilterInterface $inputFilter; diff --git a/src/User/src/Form/RegisterForm.php b/src/User/src/Form/RegisterForm.php index f9d006fa..97a8b597 100644 --- a/src/User/src/Form/RegisterForm.php +++ b/src/User/src/Form/RegisterForm.php @@ -11,8 +11,10 @@ use Laminas\Form\Element\Password; use Laminas\Form\Element\Submit; use Laminas\Form\Form; +use Laminas\Form\FormInterface; use Laminas\InputFilter\InputFilterInterface; +/** @template-extends Form */ class RegisterForm extends Form { protected InputFilterInterface $inputFilter; diff --git a/src/User/src/Form/RequestResetPasswordForm.php b/src/User/src/Form/RequestResetPasswordForm.php index 7274590b..b807c9ab 100644 --- a/src/User/src/Form/RequestResetPasswordForm.php +++ b/src/User/src/Form/RequestResetPasswordForm.php @@ -8,8 +8,10 @@ use Laminas\Form\Element\Email; use Laminas\Form\Element\Submit; use Laminas\Form\Form; +use Laminas\Form\FormInterface; use Laminas\InputFilter\InputFilterInterface; +/** @template-extends Form */ class RequestResetPasswordForm extends Form { protected InputFilterInterface $inputFilter; diff --git a/src/User/src/Form/ResetPasswordForm.php b/src/User/src/Form/ResetPasswordForm.php index 582d0324..972a23ba 100644 --- a/src/User/src/Form/ResetPasswordForm.php +++ b/src/User/src/Form/ResetPasswordForm.php @@ -8,8 +8,10 @@ use Laminas\Form\Element\Password; use Laminas\Form\Element\Submit; use Laminas\Form\Form; +use Laminas\Form\FormInterface; use Laminas\InputFilter\InputFilterInterface; +/** @template-extends Form */ class ResetPasswordForm extends Form { protected InputFilterInterface $inputFilter; diff --git a/src/User/src/Form/UploadAvatarForm.php b/src/User/src/Form/UploadAvatarForm.php index 1490970f..8f334236 100644 --- a/src/User/src/Form/UploadAvatarForm.php +++ b/src/User/src/Form/UploadAvatarForm.php @@ -7,8 +7,10 @@ use Frontend\User\Fieldset\AvatarFieldset; use Laminas\Form\Element\Submit; use Laminas\Form\Form; +use Laminas\Form\FormInterface; use Laminas\InputFilter\InputFilterInterface; +/** @template-extends Form */ class UploadAvatarForm extends Form { protected InputFilterInterface $inputFilter;