Fixed some deprecations.

This commit is contained in:
Jan Böhmer 2022-08-14 19:09:07 +02:00
parent 4fa8eef1bf
commit 5fd608f42a
59 changed files with 202 additions and 165 deletions

View file

@ -52,9 +52,9 @@ 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 string $attribute
* @param string $attribute
*/
protected function voteOnUser($attribute, $subject, User $user): bool
protected function voteOnUser(string $attribute, $subject, User $user): bool
{
return $this->resolver->inherit($user, 'parts_attachments', $attribute) ?? false;
}
@ -62,12 +62,12 @@ class AttachmentVoter extends ExtendedVoter
/**
* Determines if the attribute and subject are supported by this voter.
*
* @param string $attribute An attribute
* @param string $attribute An attribute
* @param mixed $subject The subject to secure, e.g. an object the user wants to access or any other PHP type
*
* @return bool True if the attribute and subject are supported, false otherwise
*/
protected function supports($attribute, $subject)
protected function supports(string $attribute, $subject): bool
{
if (is_a($subject, Attachment::class, true)) {
return in_array($attribute, $this->resolver->listOperationsForPermission('parts_attachments'), false);