- 
                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
IBX-10507: Allowed nullable type declarations for method parameters across the codebase #119
Conversation
| */ | ||
| public function resetUserPassword( | ||
| UserPasswordResetData $data = null, | ||
| ?UserPasswordResetData $data = null, | 
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.
Can't we enforce $data to be just UserPasswordData without null if we really don't support null?
In the user package it's executed only in 1 place where $data is not null
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.
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) 😉
| if ($data->getEmail() === null){ | ||
| throw new InvalidArgumentException('Email cannot be null'); | ||
| } | 
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:
 ------ ------------------------------------------------------------------------------------------------------------------------------------ 
  Line   src/bundle/Controller/UserInvitationController.php                                                                                  
 ------ ------------------------------------------------------------------------------------------------------------------------------------ 
  58     Parameter #1 $email of class Ibexa\Contracts\User\Invitation\InvitationCreateStruct constructor expects string, string|null given.  
         🪪  argument.type                                                                                                                   
 ------ --------------------------------------------------------------------
…d unused import in UserInvitationController
| 
 | 



Description:
Allowed nullable type declarations for method parameters across the codebase