mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-28 23:05:11 +02:00
Fixed some issues detected by PHPstan.
This commit is contained in:
parent
f2ff77a8b3
commit
dd1f806c4e
30 changed files with 310 additions and 45 deletions
|
@ -34,14 +34,17 @@ class AttachmentVoter extends ExtendedVoter
|
|||
* Similar to voteOnAttribute, but checking for the anonymous user is already done.
|
||||
* The current user (or the anonymous user) is passed by $user.
|
||||
*
|
||||
* @param $attribute
|
||||
* @param $subject
|
||||
* @param string $attribute
|
||||
* @param mixed $subject
|
||||
* @return bool
|
||||
*/
|
||||
protected function voteOnUser($attribute, $subject, User $user): bool
|
||||
{
|
||||
if ($subject instanceof Attachment) {
|
||||
return $this->resolver->inherit($user, 'parts_attachments', $attribute) ?? false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue