diff --git a/phpstan-types.neon b/phpstan-types.neon index dca84e17f..a91800d99 100644 --- a/phpstan-types.neon +++ b/phpstan-types.neon @@ -495,11 +495,6 @@ parameters: count: 2 path: src/Bundle/ChillMainBundle/Security/Authorization/AbstractChillVoter.php - - - message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" - count: 2 - path: src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelper.php - - message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" count: 2 diff --git a/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php b/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php index 64d010f27..bfc3b0026 100644 --- a/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php +++ b/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php @@ -15,7 +15,6 @@ use Chill\MainBundle\Security\ProvideRoleHierarchyInterface; use Chill\MainBundle\Entity\User; use Chill\ActivityBundle\Entity\Activity; use Chill\PersonBundle\Entity\Person; -use Symfony\Component\Security\Core\Role\Role; use Symfony\Component\Security\Core\Security; class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface @@ -115,7 +114,7 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn } } elseif ($subject instanceof AccompanyingPeriod) { if (AccompanyingPeriod::STEP_CLOSED === $subject->getStep()) { - if (\in_array($attribute, [self::UPDATE, self::CREATE, self::DELETE])) { + if (\in_array($attribute, [self::UPDATE, self::CREATE, self::DELETE], true)) { return false; } } diff --git a/src/Bundle/ChillDocStoreBundle/Security/Authorization/AccompanyingCourseDocumentVoter.php b/src/Bundle/ChillDocStoreBundle/Security/Authorization/AccompanyingCourseDocumentVoter.php index 7b3efc416..e350c6dd8 100644 --- a/src/Bundle/ChillDocStoreBundle/Security/Authorization/AccompanyingCourseDocumentVoter.php +++ b/src/Bundle/ChillDocStoreBundle/Security/Authorization/AccompanyingCourseDocumentVoter.php @@ -1,20 +1,18 @@ getCourse()->getStep() - && \in_array($attribute, [self::CREATE, self::DELETE, self::UPDATE])) { + && \in_array($attribute, [self::CREATE, self::DELETE, self::UPDATE], true)) { return false; } } diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php index b667d44a6..2ba445624 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php @@ -1,5 +1,7 @@ getStep()) { - if (\in_array($attribute, [self::EDIT, self::DELETE])) { + if (\in_array($attribute, [self::EDIT, self::DELETE], true)) { return false; } } diff --git a/src/Bundle/ChillTaskBundle/Security/Authorization/TaskVoter.php b/src/Bundle/ChillTaskBundle/Security/Authorization/TaskVoter.php index aa96fbb69..d7a749e74 100644 --- a/src/Bundle/ChillTaskBundle/Security/Authorization/TaskVoter.php +++ b/src/Bundle/ChillTaskBundle/Security/Authorization/TaskVoter.php @@ -4,16 +4,11 @@ declare(strict_types=1); namespace Chill\TaskBundle\Security\Authorization; -use Chill\EventBundle\Entity\Event; -use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Security\Authorization\AbstractChillVoter; -use Chill\MainBundle\Security\Authorization\AuthorizationHelperInterface; use Chill\MainBundle\Security\Authorization\VoterHelperFactoryInterface; use Chill\MainBundle\Security\Authorization\VoterHelperInterface; -use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher; use Chill\TaskBundle\Entity\AbstractTask; use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface; -use Chill\MainBundle\Security\Authorization\AuthorizationHelper; use Chill\PersonBundle\Security\Authorization\PersonVoter; use Psr\Log\LoggerInterface; use Chill\MainBundle\Security\ProvideRoleHierarchyInterface; @@ -22,9 +17,7 @@ use Chill\MainBundle\Entity\User; use Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter; -use Symfony\Component\Security\Core\Role\Role; use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Chill\TaskBundle\Security\Authorization\AuthorizationEvent; final class TaskVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface { @@ -117,7 +110,7 @@ final class TaskVoter extends AbstractChillVoter implements ProvideRoleHierarchy if ($subject instanceof AccompanyingPeriod) { if (AccompanyingPeriod::STEP_CLOSED === $subject->getStep()) { - if (\in_array($attribute, [self::UPDATE, self::CREATE_COURSE, self::DELETE])) { + if (\in_array($attribute, [self::UPDATE, self::CREATE_COURSE, self::DELETE], true)) { return false; } }