From 68d0c664029bfefd6a8c8fd47fb7b011908b201d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 14 Feb 2022 13:48:47 +0100 Subject: [PATCH] fix cs --- .../Controller/AccompanyingCourseApiController.php | 2 +- .../Security/Authorization/AccompanyingPeriodVoter.php | 4 ++-- .../Security/Authorization/AccompanyingPeriodWorkVoter.php | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php index 5909dda71..83d6c26cd 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php @@ -344,7 +344,7 @@ final class AccompanyingCourseApiController extends ApiController if ($request->getMethod() === 'POST') { $this->denyAccessUnlessGranted(AccompanyingPeriodVoter::TOGGLE_INTENSITY, $accompanyingCourse); - $status = $accompanyingCourse->getIntensity() == 'regular' ? 'occasional' : 'regular'; + $status = $accompanyingCourse->getIntensity() === 'regular' ? 'occasional' : 'regular'; $accompanyingCourse->setIntensity($status); $this->getDoctrine()->getManager()->flush(); } diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php index 2033076f5..c04062cc4 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php @@ -33,7 +33,7 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH self::DELETE, self::FULL, self::TOGGLE_CONFIDENTIAL_ALL, - self::TOGGLE_INTENSITY + self::TOGGLE_INTENSITY, ]; public const CREATE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_CREATE'; @@ -62,10 +62,10 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH * Right to toggle confidentiality. */ public const TOGGLE_CONFIDENTIAL_ALL = 'CHILL_PERSON_ACCOMPANYING_PERIOD_TOGGLE_CONFIDENTIAL_ALL'; + /** * Right to toggle urgency of parcours. */ - public const TOGGLE_INTENSITY = 'CHILL_PERSON_ACCOMPANYING_PERIOD_TOGGLE_INTENSITY'; private Security $security; diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkVoter.php index 750cdd2dd..7193c524e 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkVoter.php @@ -62,7 +62,6 @@ class AccompanyingPeriodWorkVoter extends Voter case self::UPDATE: return $this->security->isGranted(AccompanyingPeriodVoter::EDIT, $subject->getAccompanyingPeriod()); - default: throw new UnexpectedValueException("attribute {$attribute} is not supported"); }