DX: apply rector rules up to php8.0

This commit is contained in:
2023-04-15 01:05:37 +02:00
parent d8870e906f
commit dde3002100
714 changed files with 2348 additions and 9263 deletions

View File

@@ -21,11 +21,8 @@ class AccompanyingPeriodResourceVoter extends Voter
{
public const EDIT = 'CHILL_PERSON_ACCOMPANYING_PERIOD_RESOURCE_EDIT';
private AccessDecisionManagerInterface $accessDecisionManager;
public function __construct(AccessDecisionManagerInterface $accessDecisionManager)
public function __construct(private AccessDecisionManagerInterface $accessDecisionManager)
{
$this->accessDecisionManager = $accessDecisionManager;
}
protected function supports($attribute, $subject)
@@ -35,17 +32,13 @@ class AccompanyingPeriodResourceVoter extends Voter
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
{
/** @var \Chill\PersonBundle\Entity\AccompanyingPeriod\Resource $subject */
switch ($attribute) {
case self::EDIT:
return $this->accessDecisionManager->decide(
$token,
[AccompanyingPeriodVoter::EDIT],
$subject->getAccompanyingPeriod()
);
default:
throw new UnexpectedValueException("attribute not supported: {$attribute}");
}
return match ($attribute) {
self::EDIT => $this->accessDecisionManager->decide(
$token,
[AccompanyingPeriodVoter::EDIT],
$subject->getAccompanyingPeriod()
),
default => throw new UnexpectedValueException("attribute not supported: {$attribute}"),
};
}
}