mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 23:23:51 +00:00
DX: apply rector rules up to php8.0
This commit is contained in:
@@ -51,32 +51,8 @@ use function count;
|
||||
|
||||
final class AccompanyingCourseApiController extends ApiController
|
||||
{
|
||||
private AccompanyingPeriodACLAwareRepository $accompanyingPeriodACLAwareRepository;
|
||||
|
||||
private AccompanyingPeriodRepository $accompanyingPeriodRepository;
|
||||
|
||||
private EventDispatcherInterface $eventDispatcher;
|
||||
|
||||
private ReferralsSuggestionInterface $referralAvailable;
|
||||
|
||||
private Registry $registry;
|
||||
|
||||
private ValidatorInterface $validator;
|
||||
|
||||
public function __construct(
|
||||
AccompanyingPeriodRepository $accompanyingPeriodRepository,
|
||||
AccompanyingPeriodACLAwareRepository $accompanyingPeriodACLAwareRepository,
|
||||
EventDispatcherInterface $eventDispatcher,
|
||||
ReferralsSuggestionInterface $referralAvailable,
|
||||
Registry $registry,
|
||||
ValidatorInterface $validator
|
||||
) {
|
||||
$this->accompanyingPeriodRepository = $accompanyingPeriodRepository;
|
||||
$this->accompanyingPeriodACLAwareRepository = $accompanyingPeriodACLAwareRepository;
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
$this->referralAvailable = $referralAvailable;
|
||||
$this->registry = $registry;
|
||||
$this->validator = $validator;
|
||||
public function __construct(private AccompanyingPeriodRepository $accompanyingPeriodRepository, private AccompanyingPeriodACLAwareRepository $accompanyingPeriodACLAwareRepository, private EventDispatcherInterface $eventDispatcher, private ReferralsSuggestionInterface $referralAvailable, private Registry $registry, private ValidatorInterface $validator)
|
||||
{
|
||||
}
|
||||
|
||||
public function commentApi($id, Request $request, string $_format): Response
|
||||
@@ -190,20 +166,11 @@ final class AccompanyingCourseApiController extends ApiController
|
||||
//
|
||||
$this->onPostCheckACL('participation', $request, $_format, $accompanyingPeriod);
|
||||
|
||||
switch ($request->getMethod()) {
|
||||
case Request::METHOD_POST:
|
||||
$participation = $accompanyingPeriod->createParticipationFor($person);
|
||||
|
||||
break;
|
||||
|
||||
case Request::METHOD_DELETE:
|
||||
$participation = $accompanyingPeriod->closeParticipationFor($person);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new BadRequestHttpException('This method is not supported');
|
||||
}
|
||||
$participation = match ($request->getMethod()) {
|
||||
Request::METHOD_POST => $accompanyingPeriod->createParticipationFor($person),
|
||||
Request::METHOD_DELETE => $accompanyingPeriod->closeParticipationFor($person),
|
||||
default => throw new BadRequestHttpException('This method is not supported'),
|
||||
};
|
||||
|
||||
$errors = $this->validator->validate($accompanyingPeriod);
|
||||
|
||||
@@ -320,10 +287,8 @@ final class AccompanyingCourseApiController extends ApiController
|
||||
/**
|
||||
* @Route("/api/1.0/person/accompanying-course/{id}/confidential.json", name="chill_api_person_accompanying_period_confidential")
|
||||
* @ParamConverter("accompanyingCourse", options={"id": "id"})
|
||||
*
|
||||
* @param mixed $id
|
||||
*/
|
||||
public function toggleConfidentialApi(AccompanyingPeriod $accompanyingCourse, $id, Request $request)
|
||||
public function toggleConfidentialApi(AccompanyingPeriod $accompanyingCourse, mixed $id, Request $request)
|
||||
{
|
||||
if ($request->getMethod() === 'POST') {
|
||||
$this->denyAccessUnlessGranted(AccompanyingPeriodVoter::TOGGLE_CONFIDENTIAL, $accompanyingCourse);
|
||||
|
@@ -32,20 +32,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class AccompanyingCourseCommentController extends AbstractController
|
||||
{
|
||||
private EntityManagerInterface $entityManager;
|
||||
|
||||
private FormFactoryInterface $formFactory;
|
||||
|
||||
private TranslatorInterface $translator;
|
||||
|
||||
public function __construct(
|
||||
EntityManagerInterface $entityManager,
|
||||
FormFactoryInterface $formFactory,
|
||||
TranslatorInterface $translator
|
||||
) {
|
||||
$this->entityManager = $entityManager;
|
||||
$this->formFactory = $formFactory;
|
||||
$this->translator = $translator;
|
||||
public function __construct(private EntityManagerInterface $entityManager, private FormFactoryInterface $formFactory, private TranslatorInterface $translator)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -41,32 +41,8 @@ use function is_array;
|
||||
*/
|
||||
class AccompanyingCourseController extends Controller
|
||||
{
|
||||
protected EventDispatcherInterface $dispatcher;
|
||||
|
||||
protected SerializerInterface $serializer;
|
||||
|
||||
protected ValidatorInterface $validator;
|
||||
|
||||
private Registry $registry;
|
||||
|
||||
private TranslatorInterface $translator;
|
||||
|
||||
private AccompanyingPeriodWorkRepository $workRepository;
|
||||
|
||||
public function __construct(
|
||||
SerializerInterface $serializer,
|
||||
EventDispatcherInterface $dispatcher,
|
||||
ValidatorInterface $validator,
|
||||
AccompanyingPeriodWorkRepository $workRepository,
|
||||
Registry $registry,
|
||||
TranslatorInterface $translator
|
||||
) {
|
||||
$this->serializer = $serializer;
|
||||
$this->dispatcher = $dispatcher;
|
||||
$this->validator = $validator;
|
||||
$this->workRepository = $workRepository;
|
||||
$this->registry = $registry;
|
||||
$this->translator = $translator;
|
||||
public function __construct(protected SerializerInterface $serializer, protected EventDispatcherInterface $dispatcher, protected ValidatorInterface $validator, private AccompanyingPeriodWorkRepository $workRepository, private Registry $registry, private TranslatorInterface $translator)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -23,11 +23,8 @@ use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class AccompanyingCourseWorkApiController extends ApiController
|
||||
{
|
||||
private AccompanyingPeriodWorkRepository $accompanyingPeriodWorkRepository;
|
||||
|
||||
public function __construct(AccompanyingPeriodWorkRepository $accompanyingPeriodWorkRepository)
|
||||
public function __construct(private AccompanyingPeriodWorkRepository $accompanyingPeriodWorkRepository)
|
||||
{
|
||||
$this->accompanyingPeriodWorkRepository = $accompanyingPeriodWorkRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -28,28 +28,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class AccompanyingCourseWorkController extends AbstractController
|
||||
{
|
||||
private LoggerInterface $chillLogger;
|
||||
|
||||
private PaginatorFactory $paginator;
|
||||
|
||||
private SerializerInterface $serializer;
|
||||
|
||||
private TranslatorInterface $trans;
|
||||
|
||||
private AccompanyingPeriodWorkRepository $workRepository;
|
||||
|
||||
public function __construct(
|
||||
TranslatorInterface $trans,
|
||||
SerializerInterface $serializer,
|
||||
AccompanyingPeriodWorkRepository $workRepository,
|
||||
PaginatorFactory $paginator,
|
||||
LoggerInterface $chillLogger
|
||||
) {
|
||||
$this->trans = $trans;
|
||||
$this->serializer = $serializer;
|
||||
$this->workRepository = $workRepository;
|
||||
$this->paginator = $paginator;
|
||||
$this->chillLogger = $chillLogger;
|
||||
public function __construct(private TranslatorInterface $trans, private SerializerInterface $serializer, private AccompanyingPeriodWorkRepository $workRepository, private PaginatorFactory $paginator, private LoggerInterface $chillLogger)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -36,8 +36,6 @@ use function count;
|
||||
*/
|
||||
class AccompanyingPeriodController extends AbstractController
|
||||
{
|
||||
protected AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository;
|
||||
|
||||
/**
|
||||
* @var EventDispatcherInterface
|
||||
*/
|
||||
@@ -49,11 +47,10 @@ class AccompanyingPeriodController extends AbstractController
|
||||
protected $validator;
|
||||
|
||||
public function __construct(
|
||||
AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository,
|
||||
protected AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository,
|
||||
EventDispatcherInterface $eventDispatcher,
|
||||
ValidatorInterface $validator
|
||||
) {
|
||||
$this->accompanyingPeriodACLAwareRepository = $accompanyingPeriodACLAwareRepository;
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
$this->validator = $validator;
|
||||
}
|
||||
|
@@ -32,26 +32,8 @@ use Symfony\Component\Templating\EngineInterface;
|
||||
|
||||
class AccompanyingPeriodRegulationListController
|
||||
{
|
||||
private AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository;
|
||||
|
||||
private EngineInterface $engine;
|
||||
|
||||
private FormFactoryInterface $formFactory;
|
||||
|
||||
private PaginatorFactory $paginatorFactory;
|
||||
|
||||
private Security $security;
|
||||
|
||||
private TranslatableStringHelperInterface $translatableStringHelper;
|
||||
|
||||
public function __construct(AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository, EngineInterface $engine, FormFactoryInterface $formFactory, PaginatorFactory $paginatorFactory, Security $security, TranslatableStringHelperInterface $translatableStringHelper)
|
||||
public function __construct(private AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository, private EngineInterface $engine, private FormFactoryInterface $formFactory, private PaginatorFactory $paginatorFactory, private Security $security, private TranslatableStringHelperInterface $translatableStringHelper)
|
||||
{
|
||||
$this->accompanyingPeriodACLAwareRepository = $accompanyingPeriodACLAwareRepository;
|
||||
$this->engine = $engine;
|
||||
$this->formFactory = $formFactory;
|
||||
$this->paginatorFactory = $paginatorFactory;
|
||||
$this->security = $security;
|
||||
$this->translatableStringHelper = $translatableStringHelper;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -32,28 +32,8 @@ use function in_array;
|
||||
|
||||
class AccompanyingPeriodWorkEvaluationApiController
|
||||
{
|
||||
private AccompanyingPeriodWorkEvaluationRepository $accompanyingPeriodWorkEvaluationRepository;
|
||||
|
||||
private DocGeneratorTemplateRepository $docGeneratorTemplateRepository;
|
||||
|
||||
private PaginatorFactory $paginatorFactory;
|
||||
|
||||
private Security $security;
|
||||
|
||||
private SerializerInterface $serializer;
|
||||
|
||||
public function __construct(
|
||||
AccompanyingPeriodWorkEvaluationRepository $accompanyingPeriodWorkEvaluationRepository,
|
||||
DocGeneratorTemplateRepository $docGeneratorTemplateRepository,
|
||||
SerializerInterface $serializer,
|
||||
PaginatorFactory $paginatorFactory,
|
||||
Security $security
|
||||
) {
|
||||
$this->accompanyingPeriodWorkEvaluationRepository = $accompanyingPeriodWorkEvaluationRepository;
|
||||
$this->docGeneratorTemplateRepository = $docGeneratorTemplateRepository;
|
||||
$this->serializer = $serializer;
|
||||
$this->paginatorFactory = $paginatorFactory;
|
||||
$this->security = $security;
|
||||
public function __construct(private AccompanyingPeriodWorkEvaluationRepository $accompanyingPeriodWorkEvaluationRepository, private DocGeneratorTemplateRepository $docGeneratorTemplateRepository, private SerializerInterface $serializer, private PaginatorFactory $paginatorFactory, private Security $security)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -35,20 +35,8 @@ use function array_values;
|
||||
|
||||
class HouseholdApiController extends ApiController
|
||||
{
|
||||
private EventDispatcherInterface $eventDispatcher;
|
||||
|
||||
private HouseholdACLAwareRepositoryInterface $householdACLAwareRepository;
|
||||
|
||||
private HouseholdRepository $householdRepository;
|
||||
|
||||
public function __construct(
|
||||
EventDispatcherInterface $eventDispatcher,
|
||||
HouseholdRepository $householdRepository,
|
||||
HouseholdACLAwareRepositoryInterface $householdACLAwareRepository
|
||||
) {
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
$this->householdRepository = $householdRepository;
|
||||
$this->householdACLAwareRepository = $householdACLAwareRepository;
|
||||
public function __construct(private EventDispatcherInterface $eventDispatcher, private HouseholdRepository $householdRepository, private HouseholdACLAwareRepositoryInterface $householdACLAwareRepository)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -36,53 +36,14 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class HouseholdCompositionController extends AbstractController
|
||||
{
|
||||
private EngineInterface $engine;
|
||||
|
||||
private EntityManagerInterface $entityManager;
|
||||
|
||||
private FormFactoryInterface $formFactory;
|
||||
|
||||
private HouseholdCompositionRepository $householdCompositionRepository;
|
||||
|
||||
private HouseholdRepository $householdRepository;
|
||||
|
||||
private PaginatorFactory $paginatorFactory;
|
||||
|
||||
private Security $security;
|
||||
|
||||
private TranslatorInterface $translator;
|
||||
|
||||
private UrlGeneratorInterface $urlGenerator;
|
||||
|
||||
public function __construct(
|
||||
Security $security,
|
||||
HouseholdCompositionRepository $householdCompositionRepository,
|
||||
HouseholdRepository $householdRepository,
|
||||
PaginatorFactory $paginatorFactory,
|
||||
FormFactoryInterface $formFactory,
|
||||
EntityManagerInterface $entityManager,
|
||||
TranslatorInterface $translator,
|
||||
EngineInterface $engine,
|
||||
UrlGeneratorInterface $urlGenerator
|
||||
) {
|
||||
$this->security = $security;
|
||||
$this->householdCompositionRepository = $householdCompositionRepository;
|
||||
$this->paginatorFactory = $paginatorFactory;
|
||||
$this->formFactory = $formFactory;
|
||||
$this->entityManager = $entityManager;
|
||||
$this->translator = $translator;
|
||||
$this->engine = $engine;
|
||||
$this->urlGenerator = $urlGenerator;
|
||||
$this->householdRepository = $householdRepository;
|
||||
public function __construct(private Security $security, private HouseholdCompositionRepository $householdCompositionRepository, private HouseholdRepository $householdRepository, private PaginatorFactory $paginatorFactory, private FormFactoryInterface $formFactory, private EntityManagerInterface $entityManager, private TranslatorInterface $translator, private EngineInterface $engine, private UrlGeneratorInterface $urlGenerator)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/{_locale}/person/household/{household_id}/composition/{composition_id}/delete", name="chill_person_household_composition_delete")
|
||||
*
|
||||
* @param mixed $household_id
|
||||
* @param mixed $composition_id
|
||||
*/
|
||||
public function deleteAction(Request $request, $household_id, $composition_id): Response
|
||||
public function deleteAction(Request $request, mixed $household_id, mixed $composition_id): Response
|
||||
{
|
||||
$composition = $this->householdCompositionRepository->find($composition_id);
|
||||
$household = $this->householdRepository->find($household_id);
|
||||
|
@@ -23,14 +23,9 @@ class HouseholdCompositionTypeApiController extends ApiController
|
||||
*/
|
||||
protected function customizeQuery(string $action, Request $request, $query): void
|
||||
{
|
||||
switch ($action) {
|
||||
case '_index':
|
||||
$query->andWhere($query->expr()->eq('e.active', "'TRUE'"));
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new UnexpectedValueException('unexepcted action: ' . $action);
|
||||
}
|
||||
match ($action) {
|
||||
'_index' => $query->andWhere($query->expr()->eq('e.active', "'TRUE'")),
|
||||
default => throw new UnexpectedValueException('unexepcted action: ' . $action),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@@ -37,24 +37,8 @@ use function count;
|
||||
*/
|
||||
class HouseholdController extends AbstractController
|
||||
{
|
||||
private PositionRepository $positionRepository;
|
||||
|
||||
private Security $security;
|
||||
|
||||
private SerializerInterface $serializer;
|
||||
|
||||
private TranslatorInterface $translator;
|
||||
|
||||
public function __construct(
|
||||
TranslatorInterface $translator,
|
||||
PositionRepository $positionRepository,
|
||||
SerializerInterface $serializer,
|
||||
Security $security
|
||||
) {
|
||||
$this->translator = $translator;
|
||||
$this->positionRepository = $positionRepository;
|
||||
$this->serializer = $serializer;
|
||||
$this->security = $security;
|
||||
public function __construct(private TranslatorInterface $translator, private PositionRepository $positionRepository, private SerializerInterface $serializer, private Security $security)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -32,20 +32,8 @@ use function count;
|
||||
|
||||
class HouseholdMemberController extends ApiController
|
||||
{
|
||||
private UrlGeneratorInterface $generator;
|
||||
|
||||
private AccompanyingPeriodRepository $periodRepository;
|
||||
|
||||
private TranslatorInterface $translator;
|
||||
|
||||
public function __construct(
|
||||
UrlGeneratorInterface $generator,
|
||||
TranslatorInterface $translator,
|
||||
AccompanyingPeriodRepository $periodRepository
|
||||
) {
|
||||
$this->generator = $generator;
|
||||
$this->translator = $translator;
|
||||
$this->periodRepository = $periodRepository;
|
||||
public function __construct(private UrlGeneratorInterface $generator, private TranslatorInterface $translator, private AccompanyingPeriodRepository $periodRepository)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -175,10 +163,8 @@ class HouseholdMemberController extends ApiController
|
||||
* "/api/1.0/person/household/members/move.{_format}",
|
||||
* name="chill_api_person_household_members_move"
|
||||
* )
|
||||
*
|
||||
* @param mixed $_format
|
||||
*/
|
||||
public function move(Request $request, $_format): Response
|
||||
public function move(Request $request, mixed $_format): Response
|
||||
{
|
||||
try {
|
||||
/** @var MembersEditor $editor */
|
||||
|
@@ -287,8 +287,6 @@ class PersonAddressController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Chill\PersonBundle\Entity\Person $person
|
||||
*
|
||||
* @return \Symfony\Component\Validator\ConstraintViolationListInterface
|
||||
*/
|
||||
private function validatePerson(Person $person)
|
||||
|
@@ -27,19 +27,13 @@ use function in_array;
|
||||
|
||||
class PersonApiController extends ApiController
|
||||
{
|
||||
private AuthorizedCenterOnPersonCreationInterface $authorizedCenterOnPersonCreation;
|
||||
|
||||
private ConfigPersonAltNamesHelper $configPersonAltNameHelper;
|
||||
|
||||
private bool $showCenters;
|
||||
|
||||
public function __construct(
|
||||
AuthorizedCenterOnPersonCreationInterface $authorizedCenterOnPersonCreation,
|
||||
ConfigPersonAltNamesHelper $configPersonAltNameHelper,
|
||||
private AuthorizedCenterOnPersonCreationInterface $authorizedCenterOnPersonCreation,
|
||||
private ConfigPersonAltNamesHelper $configPersonAltNameHelper,
|
||||
ParameterBagInterface $parameterBag
|
||||
) {
|
||||
$this->authorizedCenterOnPersonCreation = $authorizedCenterOnPersonCreation;
|
||||
$this->configPersonAltNameHelper = $configPersonAltNameHelper;
|
||||
$this->showCenters = $parameterBag->get('chill_main')['acl']['form_show_centers'];
|
||||
}
|
||||
|
||||
|
@@ -47,68 +47,20 @@ use function is_array;
|
||||
|
||||
final class PersonController extends AbstractController
|
||||
{
|
||||
private AuthorizationHelperInterface $authorizationHelper;
|
||||
|
||||
/**
|
||||
* @var ConfigPersonAltNamesHelper
|
||||
*/
|
||||
protected $configPersonAltNameHelper;
|
||||
|
||||
/**
|
||||
* @var EventDispatcherInterface
|
||||
*/
|
||||
protected $eventDispatcher;
|
||||
|
||||
/**
|
||||
* @var PersonRepository;
|
||||
*/
|
||||
protected $personRepository;
|
||||
|
||||
/**
|
||||
* @var SimilarPersonMatcher
|
||||
*/
|
||||
protected $similarPersonMatcher;
|
||||
|
||||
/**
|
||||
* @var TranslatorInterface
|
||||
*/
|
||||
protected $translator;
|
||||
|
||||
/**
|
||||
* @var EntityManagerInterface
|
||||
*/
|
||||
private $em;
|
||||
|
||||
/**
|
||||
* @var \Psr\Log\LoggerInterface
|
||||
*/
|
||||
private $logger;
|
||||
|
||||
/**
|
||||
* @var ValidatorInterface
|
||||
*/
|
||||
private $validator;
|
||||
|
||||
public function __construct(
|
||||
AuthorizationHelperInterface $authorizationHelper,
|
||||
SimilarPersonMatcher $similarPersonMatcher,
|
||||
TranslatorInterface $translator,
|
||||
EventDispatcherInterface $eventDispatcher,
|
||||
PersonRepository $personRepository,
|
||||
ConfigPersonAltNamesHelper $configPersonAltNameHelper,
|
||||
LoggerInterface $logger,
|
||||
ValidatorInterface $validator,
|
||||
EntityManagerInterface $em,
|
||||
private AuthorizationHelperInterface $authorizationHelper,
|
||||
protected SimilarPersonMatcher $similarPersonMatcher,
|
||||
protected TranslatorInterface $translator,
|
||||
protected EventDispatcherInterface $eventDispatcher,
|
||||
/**
|
||||
* @var PersonRepository;
|
||||
*/
|
||||
protected PersonRepository $personRepository,
|
||||
protected ConfigPersonAltNamesHelper $configPersonAltNameHelper,
|
||||
private LoggerInterface $logger,
|
||||
private ValidatorInterface $validator,
|
||||
private EntityManagerInterface $em
|
||||
) {
|
||||
$this->authorizationHelper = $authorizationHelper;
|
||||
$this->similarPersonMatcher = $similarPersonMatcher;
|
||||
$this->translator = $translator;
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
$this->configPersonAltNameHelper = $configPersonAltNameHelper;
|
||||
$this->personRepository = $personRepository;
|
||||
$this->logger = $logger;
|
||||
$this->validator = $validator;
|
||||
$this->em = $em;
|
||||
}
|
||||
|
||||
public function editAction($person_id, Request $request)
|
||||
@@ -335,11 +287,10 @@ final class PersonController extends AbstractController
|
||||
/**
|
||||
* easy getting a person by his id.
|
||||
*
|
||||
* @param mixed $id
|
||||
*
|
||||
* @return \Chill\PersonBundle\Entity\Person
|
||||
*/
|
||||
private function _getPerson($id)
|
||||
private function _getPerson(mixed $id)
|
||||
{
|
||||
return $this->personRepository->find($id);
|
||||
}
|
||||
|
@@ -34,43 +34,8 @@ use function count;
|
||||
|
||||
class PersonDuplicateController extends Controller
|
||||
{
|
||||
/**
|
||||
* @var \Symfony\Component\EventDispatcher\EventDispatcherInterface
|
||||
*/
|
||||
private $eventDispatcher;
|
||||
|
||||
/**
|
||||
* @var \Chill\PersonBundle\Actions\Remove\PersonMove
|
||||
*/
|
||||
private $personMove;
|
||||
|
||||
/**
|
||||
* @var \Chill\PersonBundle\Repository\PersonRepository
|
||||
*/
|
||||
private $personRepository;
|
||||
|
||||
/**
|
||||
* @var \Chill\PersonBundle\Search\SimilarPersonMatcher
|
||||
*/
|
||||
private $similarPersonMatcher;
|
||||
|
||||
/**
|
||||
* @var \Symfony\Component\Translation\TranslatorInterface
|
||||
*/
|
||||
private $translator;
|
||||
|
||||
public function __construct(
|
||||
SimilarPersonMatcher $similarPersonMatcher,
|
||||
TranslatorInterface $translator,
|
||||
PersonRepository $personRepository,
|
||||
PersonMove $personMove,
|
||||
EventDispatcherInterface $eventDispatcher
|
||||
) {
|
||||
$this->similarPersonMatcher = $similarPersonMatcher;
|
||||
$this->translator = $translator;
|
||||
$this->personRepository = $personRepository;
|
||||
$this->personMove = $personMove;
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
public function __construct(private SimilarPersonMatcher $similarPersonMatcher, private TranslatorInterface $translator, private PersonRepository $personRepository, private PersonMove $personMove, private EventDispatcherInterface $eventDispatcher)
|
||||
{
|
||||
}
|
||||
|
||||
public function confirmAction($person1_id, $person2_id, Request $request)
|
||||
@@ -279,10 +244,8 @@ class PersonDuplicateController extends Controller
|
||||
|
||||
/**
|
||||
* easy getting a person by his id.
|
||||
*
|
||||
* @param mixed $id
|
||||
*/
|
||||
private function _getPerson($id): ?Person
|
||||
private function _getPerson(mixed $id): ?Person
|
||||
{
|
||||
return $this->personRepository->find($id);
|
||||
}
|
||||
|
@@ -25,24 +25,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
final class PersonResourceController extends AbstractController
|
||||
{
|
||||
private EntityManagerInterface $em;
|
||||
|
||||
private PersonRepository $personRepository;
|
||||
|
||||
private PersonResourceRepository $personResourceRepository;
|
||||
|
||||
private TranslatorInterface $translator;
|
||||
|
||||
public function __construct(
|
||||
PersonResourceRepository $personResourceRepository,
|
||||
PersonRepository $personRepository,
|
||||
EntityManagerInterface $em,
|
||||
TranslatorInterface $translator
|
||||
) {
|
||||
$this->personResourceRepository = $personResourceRepository;
|
||||
$this->personRepository = $personRepository;
|
||||
$this->em = $em;
|
||||
$this->translator = $translator;
|
||||
public function __construct(private PersonResourceRepository $personResourceRepository, private PersonRepository $personRepository, private EntityManagerInterface $em, private TranslatorInterface $translator)
|
||||
{
|
||||
}
|
||||
|
||||
public function deleteAction(Request $request, $person_id, $resource_id): Response
|
||||
|
@@ -40,44 +40,8 @@ use function is_int;
|
||||
|
||||
class ReassignAccompanyingPeriodController extends AbstractController
|
||||
{
|
||||
private AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository;
|
||||
|
||||
private AccompanyingPeriodRepository $courseRepository;
|
||||
|
||||
private EntityManagerInterface $em;
|
||||
|
||||
private EngineInterface $engine;
|
||||
|
||||
private FormFactoryInterface $formFactory;
|
||||
|
||||
private PaginatorFactory $paginatorFactory;
|
||||
|
||||
private Security $security;
|
||||
|
||||
private UserRender $userRender;
|
||||
|
||||
private UserRepository $userRepository;
|
||||
|
||||
public function __construct(
|
||||
AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository,
|
||||
UserRepository $userRepository,
|
||||
AccompanyingPeriodRepository $courseRepository,
|
||||
EngineInterface $engine,
|
||||
FormFactoryInterface $formFactory,
|
||||
PaginatorFactory $paginatorFactory,
|
||||
Security $security,
|
||||
UserRender $userRender,
|
||||
EntityManagerInterface $em
|
||||
) {
|
||||
$this->accompanyingPeriodACLAwareRepository = $accompanyingPeriodACLAwareRepository;
|
||||
$this->engine = $engine;
|
||||
$this->formFactory = $formFactory;
|
||||
$this->paginatorFactory = $paginatorFactory;
|
||||
$this->security = $security;
|
||||
$this->userRepository = $userRepository;
|
||||
$this->userRender = $userRender;
|
||||
$this->courseRepository = $courseRepository;
|
||||
$this->em = $em;
|
||||
public function __construct(private AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository, private UserRepository $userRepository, private AccompanyingPeriodRepository $courseRepository, private EngineInterface $engine, private FormFactoryInterface $formFactory, private PaginatorFactory $paginatorFactory, private Security $security, private UserRender $userRender, private EntityManagerInterface $em)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -21,14 +21,8 @@ use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
|
||||
class RelationshipApiController extends ApiController
|
||||
{
|
||||
private RelationshipRepository $repository;
|
||||
|
||||
private ValidatorInterface $validator;
|
||||
|
||||
public function __construct(ValidatorInterface $validator, RelationshipRepository $repository)
|
||||
public function __construct(private ValidatorInterface $validator, private RelationshipRepository $repository)
|
||||
{
|
||||
$this->validator = $validator;
|
||||
$this->repository = $repository;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -27,20 +27,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
final class ResidentialAddressController extends AbstractController
|
||||
{
|
||||
private UrlGeneratorInterface $generator;
|
||||
|
||||
private ResidentialAddressRepository $residentialAddressRepository;
|
||||
|
||||
private TranslatorInterface $translator;
|
||||
|
||||
public function __construct(
|
||||
UrlGeneratorInterface $generator,
|
||||
TranslatorInterface $translator,
|
||||
ResidentialAddressRepository $residentialAddressRepository
|
||||
) {
|
||||
$this->generator = $generator;
|
||||
$this->translator = $translator;
|
||||
$this->residentialAddressRepository = $residentialAddressRepository;
|
||||
public function __construct(private UrlGeneratorInterface $generator, private TranslatorInterface $translator, private ResidentialAddressRepository $residentialAddressRepository)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -22,11 +22,8 @@ use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class SocialWorkEvaluationApiController extends AbstractController
|
||||
{
|
||||
private PaginatorFactory $paginatorFactory;
|
||||
|
||||
public function __construct(PaginatorFactory $paginatorFactory)
|
||||
public function __construct(private PaginatorFactory $paginatorFactory)
|
||||
{
|
||||
$this->paginatorFactory = $paginatorFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -21,14 +21,8 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class SocialWorkGoalApiController extends ApiController
|
||||
{
|
||||
private GoalRepository $goalRepository;
|
||||
|
||||
private PaginatorFactory $paginator;
|
||||
|
||||
public function __construct(GoalRepository $goalRepository, PaginatorFactory $paginator)
|
||||
public function __construct(private GoalRepository $goalRepository, private PaginatorFactory $paginator)
|
||||
{
|
||||
$this->goalRepository = $goalRepository;
|
||||
$this->paginator = $paginator;
|
||||
}
|
||||
|
||||
public function listBySocialAction(Request $request, SocialAction $action): Response
|
||||
|
@@ -21,11 +21,8 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class SocialWorkResultApiController extends ApiController
|
||||
{
|
||||
private ResultRepository $resultRepository;
|
||||
|
||||
public function __construct(ResultRepository $resultRepository)
|
||||
public function __construct(private ResultRepository $resultRepository)
|
||||
{
|
||||
$this->resultRepository = $resultRepository;
|
||||
}
|
||||
|
||||
public function listByGoal(Request $request, Goal $goal): Response
|
||||
|
@@ -23,14 +23,8 @@ use function count;
|
||||
|
||||
class SocialWorkSocialActionApiController extends ApiController
|
||||
{
|
||||
private PaginatorFactory $paginator;
|
||||
|
||||
private SocialIssueRepository $socialIssueRepository;
|
||||
|
||||
public function __construct(SocialIssueRepository $socialIssueRepository, PaginatorFactory $paginator)
|
||||
public function __construct(private SocialIssueRepository $socialIssueRepository, private PaginatorFactory $paginator)
|
||||
{
|
||||
$this->socialIssueRepository = $socialIssueRepository;
|
||||
$this->paginator = $paginator;
|
||||
}
|
||||
|
||||
public function listBySocialIssueApi($id, Request $request)
|
||||
|
@@ -22,20 +22,8 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class TimelinePersonController extends AbstractController
|
||||
{
|
||||
protected EventDispatcherInterface $eventDispatcher;
|
||||
|
||||
protected PaginatorFactory $paginatorFactory;
|
||||
|
||||
protected TimelineBuilder $timelineBuilder;
|
||||
|
||||
public function __construct(
|
||||
EventDispatcherInterface $eventDispatcher,
|
||||
TimelineBuilder $timelineBuilder,
|
||||
PaginatorFactory $paginatorFactory
|
||||
) {
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
$this->timelineBuilder = $timelineBuilder;
|
||||
$this->paginatorFactory = $paginatorFactory;
|
||||
public function __construct(protected EventDispatcherInterface $eventDispatcher, protected TimelineBuilder $timelineBuilder, protected PaginatorFactory $paginatorFactory)
|
||||
{
|
||||
}
|
||||
|
||||
public function personAction(Request $request, $person_id)
|
||||
|
@@ -19,14 +19,8 @@ use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class UserAccompanyingPeriodController extends AbstractController
|
||||
{
|
||||
private AccompanyingPeriodRepository $accompanyingPeriodRepository;
|
||||
|
||||
private PaginatorFactory $paginatorFactory;
|
||||
|
||||
public function __construct(AccompanyingPeriodRepository $accompanyingPeriodRepository, PaginatorFactory $paginatorFactory)
|
||||
public function __construct(private AccompanyingPeriodRepository $accompanyingPeriodRepository, private PaginatorFactory $paginatorFactory)
|
||||
{
|
||||
$this->accompanyingPeriodRepository = $accompanyingPeriodRepository;
|
||||
$this->paginatorFactory = $paginatorFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user