-
Notifications
You must be signed in to change notification settings - Fork 2
IBX-10507: Allowed nullable type declarations for method parameters across the codebase #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
89aeb46
33ee512
0436740
e50840f
ddb78d3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,7 @@ | |
| use Ibexa\User\Form\Type\UserPasswordForgotWithLoginType; | ||
| use Ibexa\User\Form\Type\UserPasswordResetType; | ||
| use Ibexa\User\Form\Type\UserSettingUpdateType; | ||
| use InvalidArgumentException; | ||
| use Symfony\Component\Form\FormFactoryInterface; | ||
| use Symfony\Component\Form\FormInterface; | ||
| use Symfony\Component\Form\Util\StringUtil; | ||
|
|
@@ -45,7 +46,7 @@ public function __construct(FormFactoryInterface $formFactory, UrlGeneratorInter | |
|
|
||
| public function changeUserPassword( | ||
| ContentType $contentType, | ||
| UserPasswordChangeData $data = null, | ||
| ?UserPasswordChangeData $data = null, | ||
| ?string $name = null, | ||
| ?User $user = null | ||
| ): FormInterface { | ||
|
|
@@ -71,7 +72,7 @@ public function changeUserPassword( | |
| * @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException | ||
| */ | ||
| public function forgotUserPassword( | ||
| UserPasswordForgotData $data = null, | ||
| ?UserPasswordForgotData $data = null, | ||
| ?string $name = null | ||
| ): FormInterface { | ||
| $name = $name ?: StringUtil::fqcnToBlockPrefix(UserPasswordForgotType::class); | ||
|
|
@@ -88,7 +89,7 @@ public function forgotUserPassword( | |
| * @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException | ||
| */ | ||
| public function forgotUserPasswordWithLogin( | ||
| UserPasswordForgotWithLoginData $data = null, | ||
| ?UserPasswordForgotWithLoginData $data = null, | ||
| ?string $name = null | ||
| ): FormInterface { | ||
| $name = $name ?: StringUtil::fqcnToBlockPrefix(UserPasswordForgotWithLoginType::class); | ||
|
|
@@ -97,21 +98,19 @@ public function forgotUserPasswordWithLogin( | |
| } | ||
|
|
||
| /** | ||
| * @param \Ibexa\User\Form\Data\UserPasswordResetData $data | ||
| * @param string|null $name | ||
| * | ||
| * @return \Symfony\Component\Form\FormInterface | ||
| * | ||
| * @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException | ||
| */ | ||
| public function resetUserPassword( | ||
| UserPasswordResetData $data = null, | ||
| ?UserPasswordResetData $data = null, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't we enforce $data to be just In the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are right, but for the sake of efficiency let's stick to original task which is (getting rid of deprecated syntax instead of evaluating each case separately) 😉 |
||
| ?string $name = null, | ||
| ?ContentType $contentType = null, | ||
| ?User $user = null | ||
| ): FormInterface { | ||
| $name = $name ?: StringUtil::fqcnToBlockPrefix(UserPasswordResetType::class); | ||
|
|
||
| if (null === $data) { | ||
| throw new InvalidArgumentException('UserPasswordResetData is required for resetting user password'); | ||
| } | ||
| $userContentType = $contentType ?? $data->getContentType(); | ||
|
|
||
| return $this->formFactory->createNamed( | ||
|
|
@@ -127,7 +126,7 @@ public function resetUserPassword( | |
|
|
||
| public function updateUserSetting( | ||
| string $userSettingIdentifier, | ||
| UserSettingUpdateData $data = null, | ||
| ?UserSettingUpdateData $data = null, | ||
| ?string $name = null | ||
| ): FormInterface { | ||
| $name = $name ?: StringUtil::fqcnToBlockPrefix(UserSettingUpdateType::class); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do we need this check ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of phpstan Error: