mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-01 21:47:44 +00:00
Add return typing to match parent class : required in symfony 6
This commit is contained in:
parent
0e9c5090d0
commit
e70c8feb16
@ -53,13 +53,13 @@ class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleHierar
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function supports($attribute, $subject)
|
||||
protected function supports($attribute, $subject): bool
|
||||
{
|
||||
return $this->helper->supports($attribute, $subject);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool
|
||||
{
|
||||
return $this->helper->voteOnAttribute($attribute, $subject, $token);
|
||||
}
|
||||
|
@ -68,13 +68,13 @@ class BudgetElementVoter extends Voter implements ProvideRoleHierarchyInterface
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function supports($attribute, $subject)
|
||||
protected function supports($attribute, $subject): bool
|
||||
{
|
||||
return $this->voter->supports($attribute, $subject);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool
|
||||
{
|
||||
if (
|
||||
$subject instanceof Person
|
||||
|
@ -74,7 +74,7 @@ class PersonDocumentVoter extends AbstractChillVoter implements ProvideRoleHiera
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function supports($attribute, $subject)
|
||||
protected function supports($attribute, $subject): bool
|
||||
{
|
||||
return $this->voterHelper->supports($attribute, $subject);
|
||||
}
|
||||
@ -86,7 +86,7 @@ class PersonDocumentVoter extends AbstractChillVoter implements ProvideRoleHiera
|
||||
* @return bool
|
||||
*/
|
||||
#[\Override]
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool
|
||||
{
|
||||
$this->logger->debug(sprintf('Voting from %s class', self::class));
|
||||
|
||||
|
@ -82,13 +82,13 @@ class EventVoter extends AbstractChillVoter implements ProvideRoleHierarchyInter
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function supports($attribute, $subject)
|
||||
public function supports($attribute, $subject): bool
|
||||
{
|
||||
return $this->voterHelper->supports($attribute, $subject);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool
|
||||
{
|
||||
$this->logger->debug(sprintf('Voting from %s class', self::class));
|
||||
|
||||
|
@ -79,18 +79,13 @@ class ParticipationVoter extends AbstractChillVoter implements ProvideRoleHierar
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function supports($attribute, $subject)
|
||||
public function supports($attribute, $subject): bool
|
||||
{
|
||||
return $this->voterHelper->supports($attribute, $subject);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $attribute
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
#[\Override]
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool
|
||||
{
|
||||
$this->logger->debug(sprintf('Voting from %s class', self::class));
|
||||
|
||||
|
@ -46,7 +46,7 @@ class ExportsJobVoter extends AbstractChillVoter implements ProvideRoleHierarchy
|
||||
* @return bool
|
||||
*/
|
||||
#[\Override]
|
||||
protected function supports($attribute, $subject)
|
||||
protected function supports($attribute, $subject): bool
|
||||
{
|
||||
if ($subject instanceof Center) {
|
||||
return self::EXPORT === $attribute;
|
||||
@ -62,7 +62,7 @@ class ExportsJobVoter extends AbstractChillVoter implements ProvideRoleHierarchy
|
||||
* @return bool
|
||||
*/
|
||||
#[\Override]
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool
|
||||
{
|
||||
$user = $token->getUser();
|
||||
|
||||
|
@ -50,7 +50,7 @@ class JobVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterfa
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function supports($attribute, $subject)
|
||||
protected function supports($attribute, $subject): bool
|
||||
{
|
||||
if (!\in_array($attribute, self::ALL, true)) {
|
||||
return false;
|
||||
@ -68,7 +68,7 @@ class JobVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterfa
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool
|
||||
{
|
||||
if ($subject instanceof Person) {
|
||||
$center = $subject->getCenter();
|
||||
|
@ -30,7 +30,7 @@ class EntityWorkflowVoter extends Voter
|
||||
public function __construct(private readonly EntityWorkflowManager $manager, private readonly Security $security) {}
|
||||
|
||||
#[\Override]
|
||||
protected function supports($attribute, $subject)
|
||||
protected function supports($attribute, $subject): bool
|
||||
{
|
||||
return $subject instanceof EntityWorkflow && \in_array($attribute, self::getRoles(), true);
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ class WorkflowEntityDeletionVoter extends Voter
|
||||
public function __construct(private $handlers, private readonly EntityWorkflowRepository $entityWorkflowRepository) {}
|
||||
|
||||
#[\Override]
|
||||
protected function supports($attribute, $subject)
|
||||
protected function supports($attribute, $subject): bool
|
||||
{
|
||||
if (!\is_object($subject)) {
|
||||
return false;
|
||||
@ -40,7 +40,7 @@ class WorkflowEntityDeletionVoter extends Voter
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool
|
||||
{
|
||||
foreach ($this->handlers as $handler) {
|
||||
if ($handler->isObjectSupported($subject)) {
|
||||
|
@ -625,7 +625,7 @@ class AccompanyingPeriod implements
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function getGroupSequence()
|
||||
public function getGroupSequence(): array|Assert\GroupSequence
|
||||
{
|
||||
if (self::STEP_DRAFT === $this->getStep()) {
|
||||
return [[self::STEP_DRAFT]];
|
||||
|
@ -25,13 +25,13 @@ class AccompanyingPeriodCommentVoter extends Voter
|
||||
public function __construct(private readonly Security $security) {}
|
||||
|
||||
#[\Override]
|
||||
protected function supports($attribute, $subject)
|
||||
protected function supports($attribute, $subject): bool
|
||||
{
|
||||
return $subject instanceof Comment;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool
|
||||
{
|
||||
return match ($attribute) {
|
||||
self::EDIT => $this->security->isGranted(AccompanyingPeriodVoter::EDIT, $subject->getAccompanyingPeriod()),
|
||||
|
@ -23,13 +23,13 @@ class AccompanyingPeriodResourceVoter extends Voter
|
||||
public function __construct(private readonly AccessDecisionManagerInterface $accessDecisionManager) {}
|
||||
|
||||
#[\Override]
|
||||
protected function supports($attribute, $subject)
|
||||
protected function supports($attribute, $subject): bool
|
||||
{
|
||||
return $subject instanceof Resource && self::EDIT === $attribute;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool
|
||||
{
|
||||
return match ($attribute) {
|
||||
self::EDIT => $this->accessDecisionManager->decide(
|
||||
|
@ -151,7 +151,7 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function supports($attribute, $subject)
|
||||
protected function supports($attribute, $subject): bool
|
||||
{
|
||||
return $this->voterHelper->supports($attribute, $subject);
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ class AccompanyingPeriodWorkEvaluationDocumentVoter extends Voter
|
||||
public function __construct(private readonly AccessDecisionManagerInterface $accessDecisionManager) {}
|
||||
|
||||
#[\Override]
|
||||
protected function supports($attribute, $subject)
|
||||
protected function supports($attribute, $subject): bool
|
||||
{
|
||||
return $subject instanceof AccompanyingPeriodWorkEvaluationDocument
|
||||
&& self::SEE === $attribute;
|
||||
|
@ -31,7 +31,7 @@ class AccompanyingPeriodWorkEvaluationVoter extends Voter implements ChillVoterI
|
||||
public function __construct(private readonly Security $security) {}
|
||||
|
||||
#[\Override]
|
||||
protected function supports($attribute, $subject)
|
||||
protected function supports($attribute, $subject): bool
|
||||
{
|
||||
return $subject instanceof AccompanyingPeriodWorkEvaluation
|
||||
&& \in_array($attribute, self::ALL, true);
|
||||
|
@ -70,7 +70,7 @@ class HouseholdVoter extends Voter implements ProvideRoleHierarchyInterface, Chi
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function supports($attribute, $subject)
|
||||
protected function supports($attribute, $subject): bool
|
||||
{
|
||||
return ($subject instanceof Household
|
||||
&& \in_array($attribute, self::ALL, true))
|
||||
|
@ -58,7 +58,7 @@ class ReportVoter extends AbstractChillVoter implements ProvideRoleHierarchyInte
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function supports($attribute, $subject)
|
||||
protected function supports($attribute, $subject): bool
|
||||
{
|
||||
if ($subject instanceof Report) {
|
||||
return \in_array($attribute, [
|
||||
@ -72,7 +72,7 @@ class ReportVoter extends AbstractChillVoter implements ProvideRoleHierarchyInte
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool
|
||||
{
|
||||
if (!$token->getUser() instanceof User) {
|
||||
return false;
|
||||
|
@ -84,13 +84,13 @@ final class TaskVoter extends AbstractChillVoter implements ProvideRoleHierarchy
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public function supports($attribute, $subject)
|
||||
public function supports($attribute, $subject): bool
|
||||
{
|
||||
return $this->voter->supports($attribute, $subject);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool
|
||||
{
|
||||
if (!$token->getUser() instanceof User) {
|
||||
return false;
|
||||
|
@ -62,7 +62,7 @@ class ThirdPartyVoter extends AbstractChillVoter implements ProvideRoleHierarchy
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function supports($attribute, $subject)
|
||||
protected function supports($attribute, $subject): bool
|
||||
{
|
||||
if ($subject instanceof ThirdParty) {
|
||||
return \in_array($attribute, $this->getRoles(), true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user