apply more cs rules for php-cs

This commit is contained in:
2023-10-17 13:27:03 +02:00
parent 0b0cbed9db
commit bc2041cbdd
1485 changed files with 8169 additions and 9620 deletions

View File

@@ -16,7 +16,6 @@ use Chill\MainBundle\Entity\NotificationComment;
use Chill\MainBundle\Entity\User;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
use UnexpectedValueException;
final class NotificationVoter extends Voter
{
@@ -42,7 +41,6 @@ final class NotificationVoter extends Voter
/**
* @param string $attribute
* @param mixed $subject
*/
protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool
{
@@ -59,7 +57,7 @@ final class NotificationVoter extends Voter
),
self::NOTIFICATION_SEE, self::NOTIFICATION_TOGGLE_READ_STATUS => $subject->getSender() === $user || $subject->getAddressees()->contains($user),
self::NOTIFICATION_UPDATE => $subject->getSender() === $user && false === $subject->isSystem(),
default => throw new UnexpectedValueException("this subject {$attribute} is not implemented"),
default => throw new \UnexpectedValueException("this subject {$attribute} is not implemented"),
};
} elseif ($subject instanceof NotificationComment) {
return match ($attribute) {
@@ -67,10 +65,10 @@ final class NotificationVoter extends Voter
$subject->getNotification()->getAddressees()->contains($user) || $subject->getNotification()->getSender() === $user
),
self::COMMENT_EDIT => $subject->getCreatedBy() === $user && false === $subject->getNotification()->isSystem(),
default => throw new UnexpectedValueException("this subject {$attribute} is not implemented"),
default => throw new \UnexpectedValueException("this subject {$attribute} is not implemented"),
};
}
throw new UnexpectedValueException();
throw new \UnexpectedValueException();
}
}