tests: Fix "...Class "Chill\MainBundle\Security\Resolver\CenterResolverDispatcher" is declared "final" and cannot be mocked....".

This commit is contained in:
Pol Dellaiera 2021-11-23 12:13:47 +01:00
parent 45063fa6fe
commit 70ed9e75db
No known key found for this signature in database
GPG Key ID: D476DFE9C67467CA
15 changed files with 80 additions and 82 deletions

View File

@ -1,36 +1,15 @@
<?php <?php
/* declare(strict_types=1);
* Chill is a software for social workers
*
* Copyright (C) 2021, Champs Libres Cooperative SCRLFS,
* <http://www.champs-libres.coop>, <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\ActivityBundle\Repository; namespace Chill\ActivityBundle\Repository;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher; use Chill\MainBundle\Security\Resolver\CenterResolverDispatcherInterface;
use Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Entity\Person;
use Chill\ActivityBundle\Repository\ActivityRepository;
use Chill\ActivityBundle\Security\Authorization\ActivityVoter; use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
use Chill\MainBundle\Entity\Scope; use Chill\MainBundle\Entity\Scope;
use Doctrine\ORM\QueryBuilder;
use Doctrine\ORM\Query\Expr\Orx;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper; use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Role\Role; use Symfony\Component\Security\Core\Role\Role;
@ -50,11 +29,11 @@ final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInte
private Security $security; private Security $security;
private CenterResolverDispatcher $centerResolverDispatcher; private CenterResolverDispatcherInterface $centerResolverDispatcher;
public function __construct( public function __construct(
AuthorizationHelper $authorizationHelper, AuthorizationHelper $authorizationHelper,
CenterResolverDispatcher $centerResolverDispatcher, CenterResolverDispatcherInterface $centerResolverDispatcher,
TokenStorageInterface $tokenStorage, TokenStorageInterface $tokenStorage,
ActivityRepository $repository, ActivityRepository $repository,
EntityManagerInterface $em, EntityManagerInterface $em,

View File

@ -6,23 +6,13 @@ namespace Chill\MainBundle\Security\Authorization;
use Chill\MainBundle\Entity\User; use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\Center;
use Chill\MainBundle\Entity\HasCenterInterface;
use Chill\MainBundle\Entity\HasScopeInterface;
use Chill\MainBundle\Repository\UserACLAwareRepository;
use Chill\MainBundle\Repository\UserACLAwareRepositoryInterface; use Chill\MainBundle\Repository\UserACLAwareRepositoryInterface;
use Chill\MainBundle\Security\ParentRoleHelper; use Chill\MainBundle\Security\ParentRoleHelper;
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher; use Chill\MainBundle\Security\Resolver\CenterResolverDispatcherInterface;
use Chill\MainBundle\Security\Resolver\ScopeResolverDispatcher; use Chill\MainBundle\Security\Resolver\ScopeResolverDispatcher;
use Chill\MainBundle\Security\Resolver\ScopeResolverInterface;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\Security\Core\Role\RoleHierarchyInterface;
use Symfony\Component\Security\Core\Role\Role; use Symfony\Component\Security\Core\Role\Role;
use Chill\MainBundle\Entity\Scope; use Chill\MainBundle\Entity\Scope;
use Chill\MainBundle\Security\RoleProvider;
use Doctrine\ORM\EntityManagerInterface;
use Chill\MainBundle\Entity\GroupCenter;
use Chill\MainBundle\Entity\RoleScope;
use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Core\User\UserInterface;
/** /**
@ -32,7 +22,7 @@ use Symfony\Component\Security\Core\User\UserInterface;
*/ */
class AuthorizationHelper implements AuthorizationHelperInterface class AuthorizationHelper implements AuthorizationHelperInterface
{ {
private CenterResolverDispatcher $centerResolverDispatcher; private CenterResolverDispatcherInterface $centerResolverDispatcher;
private ScopeResolverDispatcher $scopeResolverDispatcher; private ScopeResolverDispatcher $scopeResolverDispatcher;
@ -43,7 +33,7 @@ class AuthorizationHelper implements AuthorizationHelperInterface
private ParentRoleHelper $parentRoleHelper; private ParentRoleHelper $parentRoleHelper;
public function __construct( public function __construct(
CenterResolverDispatcher $centerResolverDispatcher, CenterResolverDispatcherInterface $centerResolverDispatcher,
LoggerInterface $logger, LoggerInterface $logger,
ScopeResolverDispatcher $scopeResolverDispatcher, ScopeResolverDispatcher $scopeResolverDispatcher,
UserACLAwareRepositoryInterface $userACLAwareRepository, UserACLAwareRepositoryInterface $userACLAwareRepository,

View File

@ -6,23 +6,22 @@ namespace Chill\MainBundle\Security\Authorization;
use Chill\MainBundle\Entity\User; use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher; use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher;
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcherInterface;
final class DefaultVoterHelper implements VoterHelperInterface final class DefaultVoterHelper implements VoterHelperInterface
{ {
protected AuthorizationHelper $authorizationHelper; protected AuthorizationHelper $authorizationHelper;
protected CenterResolverDispatcher $centerResolverDispatcher; protected CenterResolverDispatcherInterface $centerResolverDispatcher;
protected array $configuration = []; protected array $configuration = [];
/** /**
* @param AuthorizationHelper $authorizationHelper
* @param CenterResolverDispatcher $centerResolverDispatcher
* @param array $configuration * @param array $configuration
*/ */
public function __construct( public function __construct(
AuthorizationHelper $authorizationHelper, AuthorizationHelper $authorizationHelper,
CenterResolverDispatcher $centerResolverDispatcher, CenterResolverDispatcherInterface $centerResolverDispatcher,
array $configuration array $configuration
) { ) {
$this->authorizationHelper = $authorizationHelper; $this->authorizationHelper = $authorizationHelper;
@ -34,11 +33,11 @@ final class DefaultVoterHelper implements VoterHelperInterface
{ {
foreach ($this->configuration as list($attributes, $subj)) { foreach ($this->configuration as list($attributes, $subj)) {
if ($subj === null) { if ($subj === null) {
if ($subject === null && \in_array($attribute, $attributes)) { if ($subject === null && \in_array($attribute, $attributes, true)) {
return true; return true;
} }
} elseif ($subject instanceof $subj) { } elseif ($subject instanceof $subj) {
return \in_array($attribute, $attributes); return \in_array($attribute, $attributes, true);
} }
} }

View File

@ -4,16 +4,16 @@ declare(strict_types=1);
namespace Chill\MainBundle\Security\Authorization; namespace Chill\MainBundle\Security\Authorization;
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher; use Chill\MainBundle\Security\Resolver\CenterResolverDispatcherInterface;
class DefaultVoterHelperFactory implements VoterHelperFactoryInterface class DefaultVoterHelperFactory implements VoterHelperFactoryInterface
{ {
protected AuthorizationHelper $authorizationHelper; protected AuthorizationHelper $authorizationHelper;
protected CenterResolverDispatcher $centerResolverDispatcher; protected CenterResolverDispatcherInterface $centerResolverDispatcher;
public function __construct( public function __construct(
AuthorizationHelper $authorizationHelper, AuthorizationHelper $authorizationHelper,
CenterResolverDispatcher $centerResolverDispatcher CenterResolverDispatcherInterface $centerResolverDispatcher
) { ) {
$this->authorizationHelper = $authorizationHelper; $this->authorizationHelper = $authorizationHelper;
$this->centerResolverDispatcher = $centerResolverDispatcher; $this->centerResolverDispatcher = $centerResolverDispatcher;

View File

@ -1,18 +1,20 @@
<?php <?php
declare(strict_types=1);
namespace Chill\MainBundle\Security\Authorization; namespace Chill\MainBundle\Security\Authorization;
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher; use Chill\MainBundle\Security\Resolver\CenterResolverDispatcherInterface;
final class DefaultVoterHelperGenerator implements VoterGeneratorInterface final class DefaultVoterHelperGenerator implements VoterGeneratorInterface
{ {
protected AuthorizationHelper $authorizationHelper; protected AuthorizationHelper $authorizationHelper;
protected CenterResolverDispatcher $centerResolverDispatcher; protected CenterResolverDispatcherInterface $centerResolverDispatcher;
protected array $configuration = []; protected array $configuration = [];
public function __construct( public function __construct(
AuthorizationHelper $authorizationHelper, AuthorizationHelper $authorizationHelper,
CenterResolverDispatcher $centerResolverDispatcher CenterResolverDispatcherInterface $centerResolverDispatcher
) { ) {
$this->authorizationHelper = $authorizationHelper; $this->authorizationHelper = $authorizationHelper;
$this->centerResolverDispatcher = $centerResolverDispatcher; $this->centerResolverDispatcher = $centerResolverDispatcher;

View File

@ -4,12 +4,8 @@ declare(strict_types=1);
namespace Chill\MainBundle\Security\Resolver; namespace Chill\MainBundle\Security\Resolver;
use Chill\MainBundle\Entity\Center;
/** final class CenterResolverDispatcher implements CenterResolverDispatcherInterface
* @deprecated Use CenterResolverManager and its interface CenterResolverManagerInterface
*/
final class CenterResolverDispatcher
{ {
/** /**
* @var CenterResolverInterface[] * @var CenterResolverInterface[]
@ -21,10 +17,6 @@ final class CenterResolverDispatcher
$this->resolvers = $resolvers; $this->resolvers = $resolvers;
} }
/**
* @param object $entity
* @return null|Center|Center[]
*/
public function resolveCenter($entity, ?array $options = []) public function resolveCenter($entity, ?array $options = [])
{ {
trigger_deprecation( trigger_deprecation(

View File

@ -0,0 +1,19 @@
<?php
declare(strict_types=1);
namespace Chill\MainBundle\Security\Resolver;
use Chill\MainBundle\Entity\Center;
/**
* @deprecated Use CenterResolverManager and its interface CenterResolverManagerInterface
*/
interface CenterResolverDispatcherInterface
{
/**
* @param object $entity
* @return null|Center|Center[]
*/
public function resolveCenter($entity, ?array $options = []);
}

View File

@ -1,14 +1,17 @@
<?php <?php
declare(strict_types=1);
namespace Chill\MainBundle\Tests\Security\Resolver; namespace Chill\MainBundle\Tests\Security\Resolver;
use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\Center;
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher; use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher;
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcherInterface;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
class CenterResolverDispatcherTest extends KernelTestCase class CenterResolverDispatcherTest extends KernelTestCase
{ {
private CenterResolverDispatcher $dispatcher; private CenterResolverDispatcherInterface $dispatcher;
protected function setUp() protected function setUp()
{ {

View File

@ -70,3 +70,4 @@ services:
- "@chill.main.security.authorization.helper" - "@chill.main.security.authorization.helper"
- "@security.token_storage" - "@security.token_storage"
Chill\MainBundle\Security\Resolver\CenterResolverDispatcherInterface: '@Chill\MainBundle\Security\Resolver\CenterResolverDispatcher'

View File

@ -1,9 +1,11 @@
<?php <?php
declare(strict_types=1);
namespace Chill\PersonBundle\Repository; namespace Chill\PersonBundle\Repository;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper; use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher; use Chill\MainBundle\Security\Resolver\CenterResolverDispatcherInterface;
use Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Entity\Person;
use Symfony\Component\Security\Core\Security; use Symfony\Component\Security\Core\Security;
@ -13,10 +15,14 @@ final class AccompanyingPeriodACLAwareRepository implements AccompanyingPeriodAC
private AccompanyingPeriodRepository $accompanyingPeriodRepository; private AccompanyingPeriodRepository $accompanyingPeriodRepository;
private Security $security; private Security $security;
private AuthorizationHelper $authorizationHelper; private AuthorizationHelper $authorizationHelper;
private CenterResolverDispatcher $centerResolverDispatcher; private CenterResolverDispatcherInterface $centerResolverDispatcher;
public function __construct(AccompanyingPeriodRepository $accompanyingPeriodRepository, Security $security, AuthorizationHelper $authorizationHelper, CenterResolverDispatcher $centerResolverDispatcher) public function __construct(
{ AccompanyingPeriodRepository $accompanyingPeriodRepository,
Security $security,
AuthorizationHelper $authorizationHelper,
CenterResolverDispatcherInterface $centerResolverDispatcher
) {
$this->accompanyingPeriodRepository = $accompanyingPeriodRepository; $this->accompanyingPeriodRepository = $accompanyingPeriodRepository;
$this->security = $security; $this->security = $security;
$this->authorizationHelper = $authorizationHelper; $this->authorizationHelper = $authorizationHelper;

View File

@ -6,6 +6,7 @@ namespace Validator\Person;
use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\Center;
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher; use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher;
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcherInterface;
use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Entity\Person;
use Chill\PersonBundle\Validator\Constraints\Person\PersonHasCenter; use Chill\PersonBundle\Validator\Constraints\Person\PersonHasCenter;
use Chill\PersonBundle\Validator\Constraints\Person\PersonHasCenterValidator; use Chill\PersonBundle\Validator\Constraints\Person\PersonHasCenterValidator;
@ -48,7 +49,7 @@ class PersonHasCenterValidatorTest extends ConstraintValidatorTestCase
] ]
]); ]);
$centerResolverDispatcher = $this->createMock(CenterResolverDispatcher::class); $centerResolverDispatcher = $this->createMock(CenterResolverDispatcherInterface::class);
return new PersonHasCenterValidator($parameterBag, $centerResolverDispatcher); return new PersonHasCenterValidator($parameterBag, $centerResolverDispatcher);
} }

View File

@ -1,19 +1,22 @@
<?php <?php
declare(strict_types=1);
namespace Chill\PersonBundle\Validator\Constraints\Person; namespace Chill\PersonBundle\Validator\Constraints\Person;
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher; use Chill\MainBundle\Security\Resolver\CenterResolverDispatcherInterface;
use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Entity\Person;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
use Symfony\Component\Validator\Exception\UnexpectedTypeException; use Symfony\Component\Validator\Exception\UnexpectedTypeException;
class PersonHasCenterValidator extends \Symfony\Component\Validator\ConstraintValidator class PersonHasCenterValidator extends ConstraintValidator
{ {
private bool $centerRequired; private bool $centerRequired;
private CenterResolverDispatcher $centerResolverDispatcher; private CenterResolverDispatcherInterface $centerResolverDispatcher;
public function __construct(ParameterBagInterface $parameterBag, CenterResolverDispatcher $centerResolverDispatcher) public function __construct(ParameterBagInterface $parameterBag, CenterResolverDispatcherInterface $centerResolverDispatcher)
{ {
$this->centerRequired = $parameterBag->get('chill_person')['validation']['center_required']; $this->centerRequired = $parameterBag->get('chill_person')['validation']['center_required'];
$this->centerResolverDispatcher = $centerResolverDispatcher; $this->centerResolverDispatcher = $centerResolverDispatcher;
@ -37,8 +40,7 @@ class PersonHasCenterValidator extends \Symfony\Component\Validator\ConstraintVa
->context ->context
->buildViolation($constraint->message) ->buildViolation($constraint->message)
->atPath('center') ->atPath('center')
->addViolation() ->addViolation();
;
} }
} }
} }

View File

@ -4,7 +4,7 @@ declare(strict_types=1);
namespace Chill\TaskBundle\Controller; namespace Chill\TaskBundle\Controller;
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher; use Chill\MainBundle\Security\Resolver\CenterResolverDispatcherInterface;
use Chill\MainBundle\Templating\Listing\FilterOrderHelper; use Chill\MainBundle\Templating\Listing\FilterOrderHelper;
use Chill\MainBundle\Templating\Listing\FilterOrderHelperFactoryInterface; use Chill\MainBundle\Templating\Listing\FilterOrderHelperFactoryInterface;
use Chill\PersonBundle\Privacy\PrivacyEvent; use Chill\PersonBundle\Privacy\PrivacyEvent;
@ -36,14 +36,14 @@ final class SingleTaskController extends AbstractController
private EventDispatcherInterface $eventDispatcher; private EventDispatcherInterface $eventDispatcher;
private TimelineBuilder $timelineBuilder; private TimelineBuilder $timelineBuilder;
private LoggerInterface $logger; private LoggerInterface $logger;
private CenterResolverDispatcher $centerResolverDispatcher; private CenterResolverDispatcherInterface $centerResolverDispatcher;
private TranslatorInterface $translator; private TranslatorInterface $translator;
private PaginatorFactory $paginatorFactory; private PaginatorFactory $paginatorFactory;
private SingleTaskAclAwareRepositoryInterface $singleTaskAclAwareRepository; private SingleTaskAclAwareRepositoryInterface $singleTaskAclAwareRepository;
private FilterOrderHelperFactoryInterface $filterOrderHelperFactory; private FilterOrderHelperFactoryInterface $filterOrderHelperFactory;
public function __construct( public function __construct(
CenterResolverDispatcher $centerResolverDispatcher, CenterResolverDispatcherInterface $centerResolverDispatcher,
PaginatorFactory $paginatorFactory, PaginatorFactory $paginatorFactory,
SingleTaskAclAwareRepositoryInterface $singleTaskAclAwareRepository, SingleTaskAclAwareRepositoryInterface $singleTaskAclAwareRepository,
TranslatorInterface $translator, TranslatorInterface $translator,

View File

@ -4,14 +4,13 @@ declare(strict_types=1);
namespace Chill\TaskBundle\Form; namespace Chill\TaskBundle\Form;
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher; use Chill\MainBundle\Security\Resolver\CenterResolverDispatcherInterface;
use Chill\MainBundle\Security\Resolver\ScopeResolverDispatcher; use Chill\MainBundle\Security\Resolver\ScopeResolverDispatcher;
use Chill\TaskBundle\Security\Authorization\TaskVoter; use Chill\TaskBundle\Security\Authorization\TaskVoter;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Chill\MainBundle\Form\Type\ChillDateType; use Chill\MainBundle\Form\Type\ChillDateType;
use Chill\MainBundle\Entity\Center;
use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Extension\Core\Type\TextType;
use Chill\MainBundle\Form\Type\UserPickerType; use Chill\MainBundle\Form\Type\UserPickerType;
use Chill\MainBundle\Form\Type\ScopePickerType; use Chill\MainBundle\Form\Type\ScopePickerType;
@ -23,11 +22,14 @@ use Chill\MainBundle\Form\Type\ChillTextareaType;
class SingleTaskType extends AbstractType class SingleTaskType extends AbstractType
{ {
private ParameterBagInterface $parameterBag; private ParameterBagInterface $parameterBag;
private CenterResolverDispatcher $centerResolverDispatcher; private CenterResolverDispatcherInterface $centerResolverDispatcher;
private ScopeResolverDispatcher $scopeResolverDispatcher; private ScopeResolverDispatcher $scopeResolverDispatcher;
public function __construct(ParameterBagInterface $parameterBag, CenterResolverDispatcher $centerResolverDispatcher, ScopeResolverDispatcher $scopeResolverDispatcher) public function __construct(
{ ParameterBagInterface $parameterBag,
CenterResolverDispatcherInterface $centerResolverDispatcher,
ScopeResolverDispatcher $scopeResolverDispatcher
) {
$this->parameterBag = $parameterBag; $this->parameterBag = $parameterBag;
$this->centerResolverDispatcher = $centerResolverDispatcher; $this->centerResolverDispatcher = $centerResolverDispatcher;
$this->scopeResolverDispatcher = $scopeResolverDispatcher; $this->scopeResolverDispatcher = $scopeResolverDispatcher;

View File

@ -1,9 +1,11 @@
<?php <?php
declare(strict_types=1);
namespace Chill\TaskBundle\Repository; namespace Chill\TaskBundle\Repository;
use Chill\MainBundle\Security\Authorization\AuthorizationHelperInterface; use Chill\MainBundle\Security\Authorization\AuthorizationHelperInterface;
use Chill\MainBundle\Security\Resolver\CenterResolverDispatcher; use Chill\MainBundle\Security\Resolver\CenterResolverDispatcherInterface;
use Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Entity\Person;
use Chill\TaskBundle\Entity\SingleTask; use Chill\TaskBundle\Entity\SingleTask;
@ -17,10 +19,10 @@ final class SingleTaskAclAwareRepository implements SingleTaskAclAwareRepository
private AuthorizationHelperInterface $authorizationHelper; private AuthorizationHelperInterface $authorizationHelper;
private EntityManagerInterface $em; private EntityManagerInterface $em;
private Security $security; private Security $security;
private CenterResolverDispatcher $centerResolverDispatcher; private CenterResolverDispatcherInterface $centerResolverDispatcher;
public function __construct( public function __construct(
CenterResolverDispatcher $centerResolverDispatcher, CenterResolverDispatcherInterface $centerResolverDispatcher,
EntityManagerInterface $em, EntityManagerInterface $em,
Security $security, Security $security,
AuthorizationHelperInterface $authorizationHelper AuthorizationHelperInterface $authorizationHelper