-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
fix phpstan #31805
fix phpstan #31805
Conversation
$permissiontoread = $user->hasRight('societe', 'lire'); | ||
$permissiontodelete = $user->hasRight('societe', 'supprimer'); | ||
$permissiontoadd = $user->hasRight('societe', 'creer'); | ||
$permissiontoread = ($user->hasRight('societe', 'lire') == 1); |
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.
Does not look a good idea to do
$permissiontoread = ($user->hasRight('societe', 'lire') == 1);
everywhere when this is more natural :
$permissiontoread = $user->hasRight('societe', 'lire');
What's wrong with having
$permissiontoread = 1 ?
May be can set such var to be both boolean and int ?
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.
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.
Stupid phpstan. So what do you think of:
$permissiontoread = (bool) $user->hasRight('societe', 'lire');
instead of
$permissiontoread = ($user->hasRight('societe', 'lire') == 1);
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.
I tried...
No description provided.