mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-03-01 03:29:41 +00:00
Apply new rector rules regarding to PHP version to 8.4
This commit is contained in:
@@ -17,7 +17,7 @@ use Symfony\Component\Messenger\Attribute\AsMessageHandler;
|
||||
#[AsMessageHandler]
|
||||
class AccompanyingPeriodStepChangeMessageHandler
|
||||
{
|
||||
private const LOG_PREFIX = '[accompanying period step change message handler] ';
|
||||
private const string LOG_PREFIX = '[accompanying period step change message handler] ';
|
||||
|
||||
public function __construct(
|
||||
private readonly AccompanyingPeriodRepository $accompanyingPeriodRepository,
|
||||
|
||||
@@ -24,7 +24,7 @@ use Symfony\Component\Workflow\Registry;
|
||||
*/
|
||||
class AccompanyingPeriodStepChanger
|
||||
{
|
||||
private const LOG_PREFIX = '[AccompanyingPeriodStepChanger] ';
|
||||
private const string LOG_PREFIX = '[AccompanyingPeriodStepChanger] ';
|
||||
|
||||
public function __construct(
|
||||
private readonly EntityManagerInterface $entityManager,
|
||||
|
||||
@@ -18,9 +18,9 @@ use Symfony\Component\EventDispatcher\Event;
|
||||
*/
|
||||
class ActionEvent extends \Symfony\Contracts\EventDispatcher\Event
|
||||
{
|
||||
final public const DELETE = 'CHILL_PERSON.DELETE_ASSOCIATED_ENTITY';
|
||||
final public const string DELETE = 'CHILL_PERSON.DELETE_ASSOCIATED_ENTITY';
|
||||
|
||||
final public const MOVE = 'CHILL_PERSON.MOVE_ASSOCIATED_ENTITY';
|
||||
final public const string MOVE = 'CHILL_PERSON.MOVE_ASSOCIATED_ENTITY';
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
|
||||
@@ -26,6 +26,7 @@ class EntityPersonCRUDController extends CRUDController
|
||||
{
|
||||
public function __construct(protected ManagerRegistry $managerRegistry) {}
|
||||
|
||||
#[\Override]
|
||||
protected function generateTemplateParameter(string $action, mixed $entity, Request $request, array $defaultTemplateParameters = []): array
|
||||
{
|
||||
$templateParameters = parent::generateTemplateParameter($action, $entity, $request, $defaultTemplateParameters);
|
||||
@@ -38,6 +39,7 @@ class EntityPersonCRUDController extends CRUDController
|
||||
/**
|
||||
* Override the base method to add a filtering step to a person.
|
||||
*/
|
||||
#[\Override]
|
||||
protected function buildQueryEntities(string $action, Request $request): QueryBuilder
|
||||
{
|
||||
$qb = parent::buildQueryEntities($action, $request);
|
||||
@@ -45,6 +47,7 @@ class EntityPersonCRUDController extends CRUDController
|
||||
return $this->filterQueryEntitiesByPerson($action, $qb, $request);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function createEntity(string $action, Request $request): object
|
||||
{
|
||||
$entity = parent::createEntity($action, $request);
|
||||
@@ -102,6 +105,7 @@ class EntityPersonCRUDController extends CRUDController
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
#[\Override]
|
||||
protected function getTemplateFor($action, $entity, Request $request)
|
||||
{
|
||||
if ($this->hasCustomTemplate($action, $entity, $request)) {
|
||||
@@ -118,6 +122,7 @@ class EntityPersonCRUDController extends CRUDController
|
||||
};
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function onBeforeRedirectAfterSubmission(string $action, $entity, \Symfony\Component\Form\FormInterface $form, Request $request): ?Response
|
||||
{
|
||||
$next = $request->request->get('submit', 'save-and-close');
|
||||
|
||||
@@ -28,6 +28,7 @@ class OneToOneEntityPersonCRUDController extends CRUDController
|
||||
throw new \BadMethodCallException('Not implemented yet.');
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function getEntity($action, $id, Request $request): ?object
|
||||
{
|
||||
$entity = parent::getEntity($action, $id, $request);
|
||||
@@ -45,6 +46,7 @@ class OneToOneEntityPersonCRUDController extends CRUDController
|
||||
return $entity;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function getTemplateFor($action, $entity, Request $request)
|
||||
{
|
||||
if (!empty($this->crudConfig[$action]['template'])) {
|
||||
|
||||
@@ -17,7 +17,7 @@ use League\Csv\Reader;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
|
||||
#[\Symfony\Component\Console\Attribute\AsCommand(name: 'chill:person:import-socialwork')]
|
||||
final class ImportSocialWorkMetadata
|
||||
final readonly class ImportSocialWorkMetadata
|
||||
{
|
||||
private EntityManagerInterface $em;
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ final class AccompanyingCourseApiController extends ApiController
|
||||
throw new AccessDeniedException();
|
||||
}
|
||||
|
||||
$since = (new \DateTimeImmutable('now'))->sub(new \DateInterval('P15D'));
|
||||
$since = new \DateTimeImmutable('now')->sub(new \DateInterval('P15D'));
|
||||
|
||||
$total = $this->accompanyingPeriodRepository->countByRecentUserHistory($user, $since);
|
||||
|
||||
@@ -366,6 +366,7 @@ final class AccompanyingCourseApiController extends ApiController
|
||||
return null;
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function validate(string $action, Request $request, string $_format, $entity, array $more = []): ConstraintViolationListInterface
|
||||
{
|
||||
if ('work' !== $action) {
|
||||
|
||||
@@ -37,9 +37,9 @@ class AccompanyingCourseWorkApiController extends ApiController
|
||||
throw new AccessDeniedHttpException();
|
||||
}
|
||||
|
||||
$since = (new \DateTimeImmutable('now'))
|
||||
$since = new \DateTimeImmutable('now')
|
||||
->sub(new \DateInterval('P'.$request->query->getInt('since', 15).'D'));
|
||||
$until = (new \DateTimeImmutable('now'))
|
||||
$until = new \DateTimeImmutable('now')
|
||||
->add(new \DateInterval('P'.$request->query->getInt('since', 15).'D'));
|
||||
$total = $this->accompanyingPeriodWorkRepository
|
||||
->countNearEndDateByUser($user, $since, $until);
|
||||
@@ -62,6 +62,7 @@ class AccompanyingCourseWorkApiController extends ApiController
|
||||
return $this->json($collection, 200, [], ['groups' => ['read']]);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function getContextForSerialization(string $action, Request $request, string $_format, $entity): array
|
||||
{
|
||||
switch ($action) {
|
||||
|
||||
@@ -326,7 +326,7 @@ class AccompanyingPeriodController extends AbstractController
|
||||
]);
|
||||
}
|
||||
|
||||
return (new Response())
|
||||
return new Response()
|
||||
->setStatusCode(Response::HTTP_BAD_REQUEST)
|
||||
->setContent('You cannot re-open this period');
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class AdministrativeStatusController extends CRUDController
|
||||
{
|
||||
#[\Override]
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$query->addOrderBy('e.order', 'ASC');
|
||||
|
||||
@@ -26,6 +26,7 @@ class ClosingMotiveController extends CRUDController
|
||||
/**
|
||||
* @param string $action
|
||||
*/
|
||||
#[\Override]
|
||||
protected function createEntity($action, Request $request): object
|
||||
{
|
||||
$entity = parent::createEntity($action, $request);
|
||||
@@ -52,6 +53,7 @@ class ClosingMotiveController extends CRUDController
|
||||
*
|
||||
* @return \Doctrine\ORM\QueryBuilder|mixed
|
||||
*/
|
||||
#[\Override]
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
/* @var \Doctrine\ORM\QueryBuilder $query */
|
||||
|
||||
@@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class EmploymentStatusController extends CRUDController
|
||||
{
|
||||
#[\Override]
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$query->addOrderBy('e.order', 'ASC');
|
||||
|
||||
@@ -130,7 +130,7 @@ class HouseholdCompositionController extends AbstractController
|
||||
}
|
||||
$householdComposition = $householdCompositions->first();
|
||||
} else {
|
||||
$householdComposition = (new HouseholdComposition())
|
||||
$householdComposition = new HouseholdComposition()
|
||||
->setStartDate(new \DateTimeImmutable());
|
||||
}
|
||||
$form = $this->formFactory->create(HouseholdCompositionType::class, $householdComposition);
|
||||
|
||||
@@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class HouseholdCompositionTypeController extends CRUDController
|
||||
{
|
||||
#[\Override]
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$query->addOrderBy('e.id', 'ASC');
|
||||
|
||||
@@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class HouseholdPositionController extends CRUDController
|
||||
{
|
||||
#[\Override]
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$query->addOrderBy('e.id', 'ASC');
|
||||
|
||||
@@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class MaritalStatusController extends CRUDController
|
||||
{
|
||||
#[\Override]
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$query->addOrderBy('e.id', 'ASC');
|
||||
|
||||
@@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class OriginController extends CRUDController
|
||||
{
|
||||
#[\Override]
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$query->addOrderBy('e.id', 'ASC');
|
||||
|
||||
@@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class PersonResourceKindController extends CRUDController
|
||||
{
|
||||
#[\Override]
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$query->addOrderBy('e.id', 'ASC');
|
||||
|
||||
@@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class RelationController extends CRUDController
|
||||
{
|
||||
#[\Override]
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$query->addOrderBy('e.id', 'ASC');
|
||||
|
||||
@@ -28,6 +28,7 @@ class SocialIssueApiController extends ApiController
|
||||
$query->setParameter('now', new \DateTimeImmutable());
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator, $_format)
|
||||
{
|
||||
$query->addOrderBy('e.ordering', 'ASC');
|
||||
|
||||
@@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class EvaluationController extends CRUDController
|
||||
{
|
||||
#[\Override]
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$query->addOrderBy('e.id', 'ASC');
|
||||
|
||||
@@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class GoalController extends CRUDController
|
||||
{
|
||||
#[\Override]
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$query->addOrderBy('e.id', 'ASC');
|
||||
|
||||
@@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class ResultController extends CRUDController
|
||||
{
|
||||
#[\Override]
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$query->addOrderBy('e.id', 'ASC');
|
||||
|
||||
@@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class SocialActionController extends CRUDController
|
||||
{
|
||||
#[\Override]
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$query->addOrderBy('e.ordering', 'ASC');
|
||||
|
||||
@@ -18,6 +18,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class SocialIssueController extends CRUDController
|
||||
{
|
||||
#[\Override]
|
||||
protected function createFormFor(string $action, $entity, ?string $formClass = null, array $formOptions = []): FormInterface
|
||||
{
|
||||
if ('new' === $action) {
|
||||
@@ -31,6 +32,7 @@ class SocialIssueController extends CRUDController
|
||||
throw new \LogicException('action is not supported: '.$action);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$query->addOrderBy('e.ordering', 'ASC');
|
||||
|
||||
@@ -21,7 +21,7 @@ use Doctrine\Persistence\ObjectManager;
|
||||
*/
|
||||
class LoadAccompanyingPeriodOrigin extends AbstractFixture implements OrderedFixtureInterface
|
||||
{
|
||||
final public const ACCOMPANYING_PERIOD_ORIGIN = 'accompanying_period_origin';
|
||||
final public const string ACCOMPANYING_PERIOD_ORIGIN = 'accompanying_period_origin';
|
||||
|
||||
public static $references = [];
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ class LoadAdministrativeStatus extends Fixture implements FixtureGroupInterface
|
||||
];
|
||||
|
||||
foreach ($status as $val) {
|
||||
$administrativeStatus = (new AdministrativeStatus())
|
||||
$administrativeStatus = new AdministrativeStatus()
|
||||
->setName($val['name'])
|
||||
->setActive(true);
|
||||
$manager->persist($administrativeStatus);
|
||||
|
||||
@@ -93,20 +93,20 @@ class LoadCustomFields extends AbstractFixture implements OrderedFixtureInterfac
|
||||
|
||||
private function loadFields(ObjectManager $manager): void
|
||||
{
|
||||
$cfGroup = (new CustomFieldsGroup())
|
||||
$cfGroup = new CustomFieldsGroup()
|
||||
->setEntity(Person::class)
|
||||
->setName(['fr' => 'Données']);
|
||||
$manager->persist($cfGroup);
|
||||
|
||||
// make this group default for Person::class
|
||||
$manager->persist(
|
||||
(new CustomFieldsDefaultGroup())
|
||||
new CustomFieldsDefaultGroup()
|
||||
->setCustomFieldsGroup($cfGroup)
|
||||
->setEntity(Person::class)
|
||||
);
|
||||
|
||||
// create title field
|
||||
$customField0 = (new CustomField())
|
||||
$customField0 = new CustomField()
|
||||
->setActive(true)
|
||||
->setName(['fr' => 'Données personnalisées'])
|
||||
->setSlug('personal-data')
|
||||
@@ -117,7 +117,7 @@ class LoadCustomFields extends AbstractFixture implements OrderedFixtureInterfac
|
||||
$manager->persist($customField0);
|
||||
|
||||
// create text field
|
||||
$this->cfText = $customFieldText = (new CustomField())
|
||||
$this->cfText = $customFieldText = new CustomField()
|
||||
->setActive(true)
|
||||
->setName(['fr' => 'Remarques'])
|
||||
->setSlug('remarques')
|
||||
@@ -128,7 +128,7 @@ class LoadCustomFields extends AbstractFixture implements OrderedFixtureInterfac
|
||||
$manager->persist($customFieldText);
|
||||
|
||||
// create choice field
|
||||
$this->cfChoice = $customFieldChoice = (new CustomField())
|
||||
$this->cfChoice = $customFieldChoice = new CustomField()
|
||||
->setActive(true)
|
||||
->setName(['fr' => "Document d'identité"])
|
||||
->setSlug('document-d-identite')
|
||||
|
||||
@@ -34,7 +34,7 @@ class LoadEmploymentStatus extends Fixture implements FixtureGroupInterface
|
||||
];
|
||||
|
||||
foreach ($status as $val) {
|
||||
$employmentStatus = (new EmploymentStatus())
|
||||
$employmentStatus = new EmploymentStatus()
|
||||
->setName($val['name'])
|
||||
->setActive(true);
|
||||
$manager->persist($employmentStatus);
|
||||
|
||||
@@ -28,7 +28,7 @@ use Nelmio\Alice\Loader\NativeLoader;
|
||||
|
||||
class LoadHousehold extends Fixture implements DependentFixtureInterface
|
||||
{
|
||||
private const NUMBER_OF_HOUSEHOLD = 10;
|
||||
private const int NUMBER_OF_HOUSEHOLD = 10;
|
||||
|
||||
private readonly NativeLoader $loader;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ use Doctrine\Persistence\ObjectManager;
|
||||
|
||||
class LoadHouseholdCompositionType extends AbstractFixture implements FixtureGroupInterface
|
||||
{
|
||||
final public const TYPES = [
|
||||
final public const array TYPES = [
|
||||
['fr' => 'Couple avec enfant(s)'],
|
||||
['fr' => 'Couple sans enfant'],
|
||||
['fr' => 'Mère seule'],
|
||||
@@ -38,7 +38,7 @@ class LoadHouseholdCompositionType extends AbstractFixture implements FixtureGro
|
||||
{
|
||||
foreach (self::TYPES as $type) {
|
||||
$manager->persist(
|
||||
(new HouseholdCompositionType())
|
||||
new HouseholdCompositionType()
|
||||
->setLabel($type)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -17,13 +17,13 @@ use Doctrine\Persistence\ObjectManager;
|
||||
|
||||
class LoadHouseholdPosition extends Fixture
|
||||
{
|
||||
final public const ADULT = 'position_adulte';
|
||||
final public const string ADULT = 'position_adulte';
|
||||
|
||||
final public const CHILD = 'position_enfant';
|
||||
final public const string CHILD = 'position_enfant';
|
||||
|
||||
final public const CHILD_OUT = 'position_enfant_hors';
|
||||
final public const string CHILD_OUT = 'position_enfant_hors';
|
||||
|
||||
final public const POSITIONS_DATA = [
|
||||
final public const array POSITIONS_DATA = [
|
||||
['Adulte', true, true, 1.0, self::ADULT],
|
||||
['Enfant', true, false, 2.0, self::CHILD],
|
||||
['Enfant hors ménage', false, false, 3.0, self::CHILD_OUT],
|
||||
@@ -35,7 +35,7 @@ class LoadHouseholdPosition extends Fixture
|
||||
self::POSITIONS_DATA as [$name, $share, $allowHolder,
|
||||
$ordering, $ref, ]
|
||||
) {
|
||||
$position = (new Position())
|
||||
$position = new Position()
|
||||
->setLabel(['fr' => $name])
|
||||
->setAllowHolder($allowHolder)
|
||||
->setShareHousehold($share)
|
||||
|
||||
@@ -45,7 +45,7 @@ use Symfony\Component\Workflow\Registry;
|
||||
*/
|
||||
class LoadPeople extends Fixture implements OrderedFixtureInterface
|
||||
{
|
||||
final public const PERSON = 'person';
|
||||
final public const string PERSON = 'person';
|
||||
|
||||
/**
|
||||
* @var array|Center[]
|
||||
@@ -343,7 +343,7 @@ class LoadPeople extends Fixture implements OrderedFixtureInterface
|
||||
private function addAPerson(Person $person, ObjectManager $manager): void
|
||||
{
|
||||
$accompanyingPeriod = new AccompanyingPeriod(
|
||||
(new \DateTime())
|
||||
new \DateTime()
|
||||
->sub(
|
||||
new \DateInterval('P'.\random_int(0, 180).'D')
|
||||
)
|
||||
|
||||
@@ -43,32 +43,32 @@ class LoadPersonACL extends AbstractFixture implements OrderedFixtureInterface
|
||||
case 'social':
|
||||
case 'direction':
|
||||
$permissionsGroup->addRoleScope(
|
||||
(new RoleScope())
|
||||
new RoleScope()
|
||||
->setRole(AccompanyingPeriodVoter::FULL)
|
||||
->setScope($scopeSocial)
|
||||
);
|
||||
|
||||
$roleScopeUpdate = (new RoleScope())
|
||||
$roleScopeUpdate = new RoleScope()
|
||||
->setRole('CHILL_PERSON_UPDATE')
|
||||
->setScope(null);
|
||||
$permissionsGroup->addRoleScope($roleScopeUpdate);
|
||||
|
||||
$roleScopeCreate = (new RoleScope())
|
||||
$roleScopeCreate = new RoleScope()
|
||||
->setRole('CHILL_PERSON_CREATE')
|
||||
->setScope(null);
|
||||
$permissionsGroup->addRoleScope($roleScopeCreate);
|
||||
|
||||
$roleScopeDuplicate = (new RoleScope())
|
||||
$roleScopeDuplicate = new RoleScope()
|
||||
->setRole('CHILL_PERSON_DUPLICATE')
|
||||
->setScope(null);
|
||||
$permissionsGroup->addRoleScope($roleScopeDuplicate);
|
||||
|
||||
$roleScopeList = (new RoleScope())
|
||||
$roleScopeList = new RoleScope()
|
||||
->setRole(PersonVoter::LISTS)
|
||||
->setScope(null);
|
||||
$permissionsGroup->addRoleScope($roleScopeList);
|
||||
|
||||
$roleScopeStats = (new RoleScope())
|
||||
$roleScopeStats = new RoleScope()
|
||||
->setRole(PersonVoter::STATS)
|
||||
->setScope(null);
|
||||
$permissionsGroup->addRoleScope($roleScopeStats);
|
||||
@@ -80,7 +80,7 @@ class LoadPersonACL extends AbstractFixture implements OrderedFixtureInterface
|
||||
break;
|
||||
|
||||
case 'administrative':
|
||||
$roleScopeSee = (new RoleScope())
|
||||
$roleScopeSee = new RoleScope()
|
||||
->setRole('CHILL_PERSON_SEE')
|
||||
->setScope(null);
|
||||
$permissionsGroup->addRoleScope($roleScopeSee);
|
||||
|
||||
@@ -18,9 +18,9 @@ use Doctrine\Persistence\ObjectManager;
|
||||
|
||||
class LoadRelations extends Fixture implements FixtureGroupInterface
|
||||
{
|
||||
final public const RELATION_KEY = 'relations';
|
||||
final public const string RELATION_KEY = 'relations';
|
||||
|
||||
final public const RELATIONS = [
|
||||
final public const array RELATIONS = [
|
||||
['title' => ['fr' => 'Parent'], 'reverseTitle' => ['fr' => 'Enfant']],
|
||||
['title' => ['fr' => 'En couple'], 'reverseTitle' => ['fr' => 'En couple']],
|
||||
['title' => ['fr' => 'Beau parent'], 'reverseTitle' => ['fr' => 'Belle-fille·beau-fils']],
|
||||
|
||||
@@ -43,7 +43,7 @@ class LoadRelationships extends Fixture implements DependentFixtureInterface
|
||||
for ($i = 0; 20 > $i; ++$i) {
|
||||
$user = $this->getRandomUser();
|
||||
$date = new \DateTimeImmutable();
|
||||
$relationship = (new Relationship())
|
||||
$relationship = new Relationship()
|
||||
->setFromPerson($this->getRandomPerson($this->em))
|
||||
->setToPerson($this->getRandomPerson($this->em))
|
||||
->setRelation($this->getReference(LoadRelations::RELATION_KEY.
|
||||
|
||||
@@ -68,21 +68,21 @@ class AccompanyingPeriod implements
|
||||
TrackCreationInterface,
|
||||
TrackUpdateInterface
|
||||
{
|
||||
final public const INTENSITIES = [self::INTENSITY_OCCASIONAL, self::INTENSITY_REGULAR];
|
||||
final public const array INTENSITIES = [self::INTENSITY_OCCASIONAL, self::INTENSITY_REGULAR];
|
||||
|
||||
/**
|
||||
* Mark an accompanying period as "occasional".
|
||||
*
|
||||
* used in INTENSITY
|
||||
*/
|
||||
final public const INTENSITY_OCCASIONAL = 'occasional';
|
||||
final public const string INTENSITY_OCCASIONAL = 'occasional';
|
||||
|
||||
/**
|
||||
* Mark an accompanying period as "regular".
|
||||
*
|
||||
* used in INTENSITY
|
||||
*/
|
||||
final public const INTENSITY_REGULAR = 'regular';
|
||||
final public const string INTENSITY_REGULAR = 'regular';
|
||||
|
||||
/**
|
||||
* Mark an accompanying period as "closed".
|
||||
@@ -90,7 +90,7 @@ class AccompanyingPeriod implements
|
||||
* This means that the accompanying period **is**
|
||||
* closed by the creator
|
||||
*/
|
||||
final public const STEP_CLOSED = 'CLOSED';
|
||||
final public const string STEP_CLOSED = 'CLOSED';
|
||||
|
||||
/**
|
||||
* Mark an accompanying period as "confirmed".
|
||||
@@ -98,7 +98,7 @@ class AccompanyingPeriod implements
|
||||
* This means that the accompanying period **is**
|
||||
* confirmed by the creator
|
||||
*/
|
||||
final public const STEP_CONFIRMED = 'CONFIRMED';
|
||||
final public const string STEP_CONFIRMED = 'CONFIRMED';
|
||||
|
||||
/**
|
||||
* Mark an accompanying period as confirmed, but inactive.
|
||||
@@ -107,7 +107,7 @@ class AccompanyingPeriod implements
|
||||
* confirmed, but no activity (Activity, AccompanyingPeriod, ...)
|
||||
* has been associated, or updated, within this accompanying period.
|
||||
*/
|
||||
final public const STEP_CONFIRMED_INACTIVE_SHORT = 'CONFIRMED_INACTIVE_SHORT';
|
||||
final public const string STEP_CONFIRMED_INACTIVE_SHORT = 'CONFIRMED_INACTIVE_SHORT';
|
||||
|
||||
/**
|
||||
* Mark an accompanying period as confirmed, but inactive.
|
||||
@@ -116,7 +116,7 @@ class AccompanyingPeriod implements
|
||||
* confirmed, but no activity (Activity, AccompanyingPeriod, ...)
|
||||
* has been associated, or updated, within this accompanying period.
|
||||
*/
|
||||
final public const STEP_CONFIRMED_INACTIVE_LONG = 'CONFIRMED_INACTIVE_LONG';
|
||||
final public const string STEP_CONFIRMED_INACTIVE_LONG = 'CONFIRMED_INACTIVE_LONG';
|
||||
|
||||
/**
|
||||
* Mark an accompanying period as "draft".
|
||||
@@ -124,7 +124,7 @@ class AccompanyingPeriod implements
|
||||
* This means that the accompanying period is not yet
|
||||
* confirmed by the creator
|
||||
*/
|
||||
final public const STEP_DRAFT = 'DRAFT';
|
||||
final public const string STEP_DRAFT = 'DRAFT';
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: Address::class)]
|
||||
private ?Address $addressLocation = null;
|
||||
|
||||
@@ -65,9 +65,9 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateInterface, \Stringable
|
||||
{
|
||||
// have days in commun
|
||||
final public const ERROR_ADDIND_PERIOD_AFTER_AN_OPEN_PERIOD = 2; // where there exist
|
||||
final public const int ERROR_ADDIND_PERIOD_AFTER_AN_OPEN_PERIOD = 2; // where there exist
|
||||
|
||||
final public const ERROR_PERIODS_ARE_COLLAPSING = 1; // when two different periods
|
||||
final public const int ERROR_PERIODS_ARE_COLLAPSING = 1; // when two different periods
|
||||
|
||||
/**
|
||||
* Accept receiving email.
|
||||
@@ -772,10 +772,10 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
* If the `$at` parameter is now, use the method `getCurrentPersonAddress`, which is optimized
|
||||
* on database side.
|
||||
*
|
||||
* @deprecated since chill2.0, address is linked to the household. Use @see{Person::getCurrentHouseholdAddress}
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
#[\Deprecated(message: 'since chill2.0, address is linked to the household. Use @see{Person::getCurrentHouseholdAddress}')]
|
||||
public function getAddressAt(?\DateTimeInterface $at = null): ?Address
|
||||
{
|
||||
$at ??= new \DateTime('now');
|
||||
@@ -933,9 +933,8 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
|
||||
/**
|
||||
* Returns the opened accompanying period.
|
||||
*
|
||||
* @deprecated since 1.1 use `getOpenedAccompanyingPeriod instead
|
||||
*/
|
||||
#[\Deprecated(message: 'since 1.1 use `getOpenedAccompanyingPeriod instead')]
|
||||
public function getCurrentAccompanyingPeriod(): ?AccompanyingPeriod
|
||||
{
|
||||
return $this->getOpenedAccompanyingPeriod();
|
||||
@@ -981,7 +980,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
{
|
||||
if (
|
||||
null === $at
|
||||
|| $at->format('Ymd') === (new \DateTime('today'))->format('Ymd')
|
||||
|| $at->format('Ymd') === new \DateTime('today')->format('Ymd')
|
||||
) {
|
||||
return $this->currentPersonAddress instanceof PersonCurrentAddress
|
||||
? $this->currentPersonAddress->getAddress() : null;
|
||||
@@ -1169,12 +1168,11 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use @see{Person::getCurrentPersonAddress} or @see{Person::getCurrentHouseholdAddress} instead
|
||||
*
|
||||
* @return false|mixed|null
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
#[\Deprecated(message: 'Use @see{Person::getCurrentPersonAddress} or @see{Person::getCurrentHouseholdAddress} instead')]
|
||||
public function getLastAddress(?\DateTime $from = null): ?Address
|
||||
{
|
||||
return $this->getCurrentHouseholdAddress(
|
||||
@@ -1391,13 +1389,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
*/
|
||||
public function isOpen(): bool
|
||||
{
|
||||
foreach ($this->getAccompanyingPeriods() as $period) {
|
||||
if ($period->isOpen()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return array_any($this->getAccompanyingPeriods(), fn($period) => $period->isOpen());
|
||||
}
|
||||
|
||||
public function isSharingHousehold(?\DateTimeImmutable $at = null): bool
|
||||
|
||||
@@ -19,7 +19,7 @@ use Symfony\Contracts\EventDispatcher\Event;
|
||||
|
||||
class PersonAddressMoveEvent extends Event
|
||||
{
|
||||
final public const PERSON_MOVE_POST = 'chill_person.person_move_post';
|
||||
final public const string PERSON_MOVE_POST = 'chill_person.person_move_post';
|
||||
|
||||
private ?Address $nextAddress = null;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
*/
|
||||
final readonly class ClosingDateAggregator implements AggregatorInterface
|
||||
{
|
||||
private const PREFIX = 'acp_closing_date_agg';
|
||||
private const string PREFIX = 'acp_closing_date_agg';
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder): void
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class CreatorJobAggregator implements AggregatorInterface
|
||||
{
|
||||
private const PREFIX = 'acp_agg_creator_job';
|
||||
private const string PREFIX = 'acp_agg_creator_job';
|
||||
|
||||
public function __construct(
|
||||
private readonly UserJobRepository $jobRepository,
|
||||
|
||||
@@ -20,7 +20,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
final readonly class DurationAggregator implements AggregatorInterface
|
||||
{
|
||||
private const CHOICES = [
|
||||
private const array CHOICES = [
|
||||
'month',
|
||||
'week',
|
||||
'day',
|
||||
|
||||
@@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final readonly class JobWorkingOnCourseAggregator implements AggregatorInterface
|
||||
{
|
||||
private const PREFIX = 'acp_agg_user_job_working_on_course';
|
||||
private const string PREFIX = 'acp_agg_user_job_working_on_course';
|
||||
|
||||
public function __construct(
|
||||
private UserJobRepositoryInterface $userJobRepository,
|
||||
|
||||
@@ -24,7 +24,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
*/
|
||||
final readonly class OpeningDateAggregator implements AggregatorInterface
|
||||
{
|
||||
private const PREFIX = 'acp_opening_date_agg';
|
||||
private const string PREFIX = 'acp_opening_date_agg';
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder): void
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final readonly class PersonParticipatingAggregator implements AggregatorInterface
|
||||
{
|
||||
private const KEY = 'acp_person_part_agg';
|
||||
private const string KEY = 'acp_person_part_agg';
|
||||
|
||||
public function __construct(
|
||||
private LabelPersonHelper $labelPersonHelper,
|
||||
|
||||
@@ -24,9 +24,9 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final readonly class ReferrerAggregator implements AggregatorInterface, DataTransformerInterface
|
||||
{
|
||||
private const A = 'acp_ref_agg_uhistory';
|
||||
private const string A = 'acp_ref_agg_uhistory';
|
||||
|
||||
private const P = 'acp_ref_agg_date';
|
||||
private const string P = 'acp_ref_agg_date';
|
||||
|
||||
public function __construct(
|
||||
private UserRepository $userRepository,
|
||||
|
||||
@@ -26,7 +26,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
readonly class ReferrerScopeAggregator implements AggregatorInterface, DataTransformerInterface
|
||||
{
|
||||
private const PREFIX = 'acp_agg_referrer_scope';
|
||||
private const string PREFIX = 'acp_agg_referrer_scope';
|
||||
|
||||
public function __construct(
|
||||
private ScopeRepositoryInterface $scopeRepository,
|
||||
|
||||
@@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final readonly class ScopeWorkingOnCourseAggregator implements AggregatorInterface
|
||||
{
|
||||
private const PREFIX = 'acp_agg_user_scope_working_on_course';
|
||||
private const string PREFIX = 'acp_agg_user_scope_working_on_course';
|
||||
|
||||
public function __construct(
|
||||
private ScopeRepositoryInterface $scopeRepository,
|
||||
|
||||
@@ -23,9 +23,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
final readonly class StepAggregator implements AggregatorInterface
|
||||
{
|
||||
private const A = 'acpstephistories';
|
||||
private const string A = 'acpstephistories';
|
||||
|
||||
private const P = 'acp_step_agg_date';
|
||||
private const string P = 'acp_step_agg_date';
|
||||
|
||||
public function __construct(private RollingDateConverterInterface $rollingDateConverter, private TranslatorInterface $translator) {}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final readonly class UserJobAggregator implements AggregatorInterface, DataTransformerInterface
|
||||
{
|
||||
private const PREFIX = 'acp_agg_user_job';
|
||||
private const string PREFIX = 'acp_agg_user_job';
|
||||
|
||||
public function __construct(
|
||||
private UserJobRepository $jobRepository,
|
||||
|
||||
@@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final readonly class UserWorkingOnCourseAggregator implements AggregatorInterface
|
||||
{
|
||||
private const COLUMN_NAME = 'user_working_on_course_user_id';
|
||||
private const string COLUMN_NAME = 'user_working_on_course_user_id';
|
||||
|
||||
public function __construct(
|
||||
private UserRender $userRender,
|
||||
|
||||
@@ -20,7 +20,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final readonly class ByClosingMotiveAggregator implements AggregatorInterface
|
||||
{
|
||||
private const KEY = 'acpstephistory_by_closing_motive_agg';
|
||||
private const string KEY = 'acpstephistory_by_closing_motive_agg';
|
||||
|
||||
public function __construct(
|
||||
private ClosingMotiveRepositoryInterface $closingMotiveRepository,
|
||||
|
||||
@@ -24,7 +24,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
*/
|
||||
final readonly class ByDateAggregator implements AggregatorInterface
|
||||
{
|
||||
private const KEY = 'acpstephistory_by_date_agg';
|
||||
private const string KEY = 'acpstephistory_by_date_agg';
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder): void
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
*/
|
||||
final readonly class ByStepAggregator implements AggregatorInterface
|
||||
{
|
||||
private const KEY = 'acpstephistory_step_agg';
|
||||
private const string KEY = 'acpstephistory_step_agg';
|
||||
|
||||
public function __construct(
|
||||
private TranslatorInterface $translator,
|
||||
|
||||
@@ -19,13 +19,13 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final class ByEndDateAggregator implements AggregatorInterface
|
||||
{
|
||||
private const CHOICES = [
|
||||
private const array CHOICES = [
|
||||
'by week' => 'week',
|
||||
'by month' => 'month',
|
||||
'by year' => 'year',
|
||||
];
|
||||
|
||||
private const DEFAULT_CHOICE = 'year';
|
||||
private const string DEFAULT_CHOICE = 'year';
|
||||
|
||||
public function addRole(): ?string
|
||||
{
|
||||
|
||||
@@ -19,13 +19,13 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final class ByMaxDateAggregator implements AggregatorInterface
|
||||
{
|
||||
private const CHOICES = [
|
||||
private const array CHOICES = [
|
||||
'by week' => 'week',
|
||||
'by month' => 'month',
|
||||
'by year' => 'year',
|
||||
];
|
||||
|
||||
private const DEFAULT_CHOICE = 'year';
|
||||
private const string DEFAULT_CHOICE = 'year';
|
||||
|
||||
public function addRole(): ?string
|
||||
{
|
||||
|
||||
@@ -19,13 +19,13 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final class ByStartDateAggregator implements AggregatorInterface
|
||||
{
|
||||
private const CHOICES = [
|
||||
private const array CHOICES = [
|
||||
'by week' => 'week',
|
||||
'by month' => 'month',
|
||||
'by year' => 'year',
|
||||
];
|
||||
|
||||
private const DEFAULT_CHOICE = 'year';
|
||||
private const string DEFAULT_CHOICE = 'year';
|
||||
|
||||
public function addRole(): ?string
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ByHouseholdCompositionAggregator implements AggregatorInterface
|
||||
{
|
||||
private const PREFIX = 'acp_by_household_compo_agg';
|
||||
private const string PREFIX = 'acp_by_household_compo_agg';
|
||||
|
||||
public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter, private readonly HouseholdCompositionTypeRepositoryInterface $householdCompositionTypeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper) {}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final readonly class CenterAggregator implements AggregatorInterface
|
||||
{
|
||||
private const COLUMN_NAME = 'person_center_aggregator';
|
||||
private const string COLUMN_NAME = 'person_center_aggregator';
|
||||
|
||||
public function __construct(
|
||||
private CenterRepositoryInterface $centerRepository,
|
||||
|
||||
@@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final readonly class PostalCodeAggregator implements AggregatorInterface
|
||||
{
|
||||
private const PREFIX = 'person_postal_code_agg';
|
||||
private const string PREFIX = 'person_postal_code_agg';
|
||||
|
||||
public function __construct(
|
||||
private RollingDateConverterInterface $rollingDateConverter,
|
||||
|
||||
@@ -20,7 +20,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class CreatorAggregator implements AggregatorInterface
|
||||
{
|
||||
private const PREFIX = 'acpw_aggr_creator';
|
||||
private const string PREFIX = 'acpw_aggr_creator';
|
||||
|
||||
public function __construct(
|
||||
private readonly UserRepository $userRepository,
|
||||
|
||||
@@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class CreatorJobAggregator implements AggregatorInterface
|
||||
{
|
||||
private const PREFIX = 'acpw_aggr_creator_job';
|
||||
private const string PREFIX = 'acpw_aggr_creator_job';
|
||||
|
||||
public function __construct(
|
||||
private readonly UserJobRepository $jobRepository,
|
||||
|
||||
@@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class CreatorScopeAggregator implements AggregatorInterface
|
||||
{
|
||||
private const PREFIX = 'acpw_aggr_creator_scope';
|
||||
private const string PREFIX = 'acpw_aggr_creator_scope';
|
||||
|
||||
public function __construct(
|
||||
private readonly ScopeRepository $scopeRepository,
|
||||
|
||||
@@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
*/
|
||||
final readonly class HandlingThirdPartyAggregator implements AggregatorInterface
|
||||
{
|
||||
private const PREFIX = 'acpw_handling3party_agg';
|
||||
private const string PREFIX = 'acpw_handling3party_agg';
|
||||
|
||||
public function __construct(private LabelThirdPartyHelper $labelThirdPartyHelper) {}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final readonly class JobAggregator implements AggregatorInterface
|
||||
{
|
||||
private const PREFIX = 'acp_work_action_agg_user_job';
|
||||
private const string PREFIX = 'acp_work_action_agg_user_job';
|
||||
|
||||
public function __construct(
|
||||
private UserJobRepository $jobRepository,
|
||||
|
||||
@@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final readonly class ReferrerAggregator implements AggregatorInterface
|
||||
{
|
||||
private const PREFIX = 'acpw_referrer_aggregator';
|
||||
private const string PREFIX = 'acpw_referrer_aggregator';
|
||||
|
||||
public function __construct(
|
||||
private UserRepository $userRepository,
|
||||
@@ -71,7 +71,7 @@ final readonly class ReferrerAggregator implements AggregatorInterface
|
||||
public function normalizeFormData(array $formData): array
|
||||
{
|
||||
if (!array_key_exists('referrer_at', $formData)) {
|
||||
return ['referrer_at' => (new RollingDate(RollingDate::T_TODAY))->normalize()];
|
||||
return ['referrer_at' => new RollingDate(RollingDate::T_TODAY)->normalize()];
|
||||
}
|
||||
|
||||
return ['referrer_at' => $formData['referrer_at']->normalize()];
|
||||
|
||||
@@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final readonly class ScopeAggregator implements AggregatorInterface
|
||||
{
|
||||
private const PREFIX = 'acp_work_action_agg_user_scope';
|
||||
private const string PREFIX = 'acp_work_action_agg_user_scope';
|
||||
|
||||
public function __construct(
|
||||
private ScopeRepository $scopeRepository,
|
||||
|
||||
@@ -24,9 +24,7 @@ abstract class Declarations
|
||||
|
||||
final public const HOUSEHOLD_TYPE = 'household';
|
||||
|
||||
/**
|
||||
* @deprecated consider using the PERSON_TYPE instead
|
||||
*/
|
||||
#[\Deprecated(message: 'consider using the PERSON_TYPE instead')]
|
||||
final public const PERSON_IMPLIED_IN = 'person_implied_in';
|
||||
|
||||
final public const PERSON_TYPE = 'person';
|
||||
|
||||
@@ -29,7 +29,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class CountHouseholdInPeriod implements ExportInterface, GroupedExportInterface
|
||||
{
|
||||
private const TR_PREFIX = 'export.export.nb_household_with_course.';
|
||||
private const string TR_PREFIX = 'export.export.nb_household_with_course.';
|
||||
private readonly bool $filterStatsByCenters;
|
||||
|
||||
public function __construct(
|
||||
|
||||
@@ -49,7 +49,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final readonly class ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod implements ListInterface, GroupedExportInterface
|
||||
{
|
||||
private const FIELDS = [
|
||||
private const array FIELDS = [
|
||||
'id',
|
||||
'socialActionId',
|
||||
'socialAction',
|
||||
|
||||
@@ -49,7 +49,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final readonly class ListAccompanyingPeriodWorkAssociatePersonOnWork implements ListInterface, GroupedExportInterface
|
||||
{
|
||||
private const FIELDS = [
|
||||
private const array FIELDS = [
|
||||
'id',
|
||||
'socialActionId',
|
||||
'socialAction',
|
||||
|
||||
@@ -42,7 +42,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
final readonly class ListEvaluation implements ListInterface, GroupedExportInterface
|
||||
{
|
||||
private const FIELDS = [
|
||||
private const array FIELDS = [
|
||||
'id',
|
||||
'startDate',
|
||||
'endDate',
|
||||
|
||||
@@ -35,7 +35,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ListHouseholdInPeriod implements ListInterface, GroupedExportInterface
|
||||
{
|
||||
private const FIELDS = [
|
||||
private const array FIELDS = [
|
||||
'id',
|
||||
'membersCount',
|
||||
'membersId',
|
||||
|
||||
@@ -33,7 +33,7 @@ class ListPersonDuplicate implements DirectExportInterface, ExportElementValidat
|
||||
/**
|
||||
* @var float
|
||||
*/
|
||||
private const PRECISION_DEFAULT_VALUE = 0.7;
|
||||
private const float PRECISION_DEFAULT_VALUE = 0.7;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
|
||||
@@ -22,12 +22,12 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class ConfidentialFilter implements FilterInterface
|
||||
{
|
||||
private const CHOICES = [
|
||||
private const array CHOICES = [
|
||||
'is not confidential' => 'false',
|
||||
'is confidential' => 'true',
|
||||
];
|
||||
|
||||
private const DEFAULT_CHOICE = 'false';
|
||||
private const string DEFAULT_CHOICE = 'false';
|
||||
|
||||
public function __construct(private readonly TranslatorInterface $translator) {}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ use Symfony\Component\Translation\TranslatableMessage;
|
||||
final readonly class CreatorJobFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
private const PREFIX = 'acp_filter_creator_job';
|
||||
private const string PREFIX = 'acp_filter_creator_job';
|
||||
|
||||
public function __construct(
|
||||
private TranslatableStringHelper $translatableStringHelper,
|
||||
|
||||
@@ -22,12 +22,12 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class EmergencyFilter implements FilterInterface
|
||||
{
|
||||
private const CHOICES = [
|
||||
private const array CHOICES = [
|
||||
'is emergency' => 'true',
|
||||
'is not emergency' => 'false',
|
||||
];
|
||||
|
||||
private const DEFAULT_CHOICE = 'false';
|
||||
private const string DEFAULT_CHOICE = 'false';
|
||||
|
||||
public function __construct(private readonly TranslatorInterface $translator) {}
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ class GeographicalUnitStatFilter implements FilterInterface
|
||||
{
|
||||
$units = array_filter(
|
||||
array_map(
|
||||
fn (int $id) => $this->geographicalUnitRepository->findSimpleGeographicalUnit($id),
|
||||
$this->geographicalUnitRepository->findSimpleGeographicalUnit(...),
|
||||
$formData['units'],
|
||||
),
|
||||
static fn (?SimpleGeographicalUnitDTO $unitDTO) => null !== $unitDTO,
|
||||
|
||||
@@ -25,7 +25,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
final readonly class HandlingThirdPartyFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
private const PREFIX = 'acpw_handling_3party_filter';
|
||||
private const string PREFIX = 'acpw_handling_3party_filter';
|
||||
|
||||
public function __construct(
|
||||
private ThirdPartyRender $thirdPartyRender,
|
||||
|
||||
@@ -22,12 +22,12 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class IntensityFilter implements FilterInterface
|
||||
{
|
||||
private const CHOICES = [
|
||||
private const array CHOICES = [
|
||||
'is occasional' => 'occasional',
|
||||
'is regular' => 'regular',
|
||||
];
|
||||
|
||||
private const DEFAULT_CHOICE = 'occasional';
|
||||
private const string DEFAULT_CHOICE = 'occasional';
|
||||
|
||||
public function __construct(private readonly TranslatorInterface $translator) {}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
readonly class JobWorkingOnCourseFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
private const PREFIX = 'acp_filter_user_job_working_on_course';
|
||||
private const string PREFIX = 'acp_filter_user_job_working_on_course';
|
||||
|
||||
public function __construct(
|
||||
private UserJobRepositoryInterface $userJobRepository,
|
||||
|
||||
@@ -27,11 +27,11 @@ final readonly class ReferrerFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
|
||||
private const A = 'acp_referrer_filter_uhistory_x';
|
||||
private const string A = 'acp_referrer_filter_uhistory_x';
|
||||
|
||||
private const P = 'acp_referrer_filter_date';
|
||||
private const string P = 'acp_referrer_filter_date';
|
||||
|
||||
private const PU = 'acp_referrer_filter_users';
|
||||
private const string PU = 'acp_referrer_filter_users';
|
||||
|
||||
public function __construct(private RollingDateConverterInterface $rollingDateConverter, private UserRepositoryInterface $userRepository, private UserRender $userRender) {}
|
||||
|
||||
|
||||
@@ -35,12 +35,12 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
final readonly class ReferrerFilterBetweenDates implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
private const A = 'acp_referrer_filter_uhistory';
|
||||
private const string A = 'acp_referrer_filter_uhistory';
|
||||
|
||||
private const P = 'acp_referrer_filter_date_start';
|
||||
private const Q = 'acp_referrer_filter_date_end';
|
||||
private const string P = 'acp_referrer_filter_date_start';
|
||||
private const string Q = 'acp_referrer_filter_date_end';
|
||||
|
||||
private const PU = 'acp_referrer_filter_users';
|
||||
private const string PU = 'acp_referrer_filter_users';
|
||||
|
||||
public function __construct(
|
||||
private RollingDateConverterInterface $rollingDateConverter,
|
||||
|
||||
@@ -23,9 +23,9 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
final readonly class RequestorFilter implements FilterInterface
|
||||
{
|
||||
private const DEFAULT_CHOICE = 'participation';
|
||||
private const string DEFAULT_CHOICE = 'participation';
|
||||
|
||||
private const REQUESTOR_CHOICES = [
|
||||
private const array REQUESTOR_CHOICES = [
|
||||
'is person concerned' => 'participation',
|
||||
'is other person' => 'other_person',
|
||||
'is thirdparty' => 'thirdparty',
|
||||
|
||||
@@ -35,7 +35,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
readonly class ScopeWorkingOnCourseFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
private const PREFIX = 'acp_filter_user_scope_working_on_course';
|
||||
private const string PREFIX = 'acp_filter_user_scope_working_on_course';
|
||||
|
||||
public function __construct(
|
||||
private ScopeRepositoryInterface $scopeRepository,
|
||||
|
||||
@@ -30,7 +30,7 @@ final readonly class SocialActionFilter implements FilterInterface
|
||||
{
|
||||
use ExportDataNormalizerTrait;
|
||||
|
||||
private const PREFIX = 'acp_by_social_action_filter';
|
||||
private const string PREFIX = 'acp_by_social_action_filter';
|
||||
|
||||
public function __construct(
|
||||
private SocialActionRender $actionRender,
|
||||
|
||||
@@ -26,13 +26,13 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class StepFilterBetweenDates implements FilterInterface
|
||||
{
|
||||
private const DEFAULT_CHOICE = [
|
||||
private const array DEFAULT_CHOICE = [
|
||||
AccompanyingPeriod::STEP_CONFIRMED,
|
||||
AccompanyingPeriod::STEP_CONFIRMED_INACTIVE_SHORT,
|
||||
AccompanyingPeriod::STEP_CONFIRMED_INACTIVE_LONG,
|
||||
];
|
||||
|
||||
private const STEPS = [
|
||||
private const array STEPS = [
|
||||
'course.draft' => AccompanyingPeriod::STEP_DRAFT,
|
||||
'course.confirmed' => AccompanyingPeriod::STEP_CONFIRMED,
|
||||
'course.closed' => AccompanyingPeriod::STEP_CLOSED,
|
||||
|
||||
@@ -29,17 +29,17 @@ class StepFilterOnDate implements FilterInterface
|
||||
{
|
||||
use ExportDataNormalizerTrait;
|
||||
|
||||
private const A = 'acp_filter_bystep_stephistories';
|
||||
private const string A = 'acp_filter_bystep_stephistories';
|
||||
|
||||
private const DEFAULT_CHOICE = [
|
||||
private const array DEFAULT_CHOICE = [
|
||||
AccompanyingPeriod::STEP_CONFIRMED,
|
||||
AccompanyingPeriod::STEP_CONFIRMED_INACTIVE_SHORT,
|
||||
AccompanyingPeriod::STEP_CONFIRMED_INACTIVE_LONG,
|
||||
];
|
||||
|
||||
private const P = 'acp_step_filter_date';
|
||||
private const string P = 'acp_step_filter_date';
|
||||
|
||||
private const STEPS = [
|
||||
private const array STEPS = [
|
||||
'course.draft' => AccompanyingPeriod::STEP_DRAFT,
|
||||
'course.confirmed' => AccompanyingPeriod::STEP_CONFIRMED,
|
||||
'course.closed' => AccompanyingPeriod::STEP_CLOSED,
|
||||
|
||||
@@ -33,7 +33,7 @@ final readonly class UserJobFilter implements FilterInterface, DataTransformerIn
|
||||
{
|
||||
use ExportDataNormalizerTrait;
|
||||
|
||||
private const PREFIX = 'acp_filter_user_job';
|
||||
private const string PREFIX = 'acp_filter_user_job';
|
||||
|
||||
public function __construct(
|
||||
private TranslatableStringHelper $translatableStringHelper,
|
||||
|
||||
@@ -31,7 +31,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
final readonly class UserScopeFilter implements FilterInterface, DataTransformerInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
private const PREFIX = 'acp_filter_main_scope';
|
||||
private const string PREFIX = 'acp_filter_main_scope';
|
||||
|
||||
public function __construct(
|
||||
private ScopeRepositoryInterface $scopeRepository,
|
||||
|
||||
@@ -21,7 +21,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class MaxDateFilter implements FilterInterface
|
||||
{
|
||||
private const MAXDATE_CHOICES = [
|
||||
private const array MAXDATE_CHOICES = [
|
||||
'maxdate is specified' => true,
|
||||
'maxdate is not specified' => false,
|
||||
];
|
||||
|
||||
@@ -111,7 +111,7 @@ final readonly class GeographicalUnitFilter implements \Chill\MainBundle\Export\
|
||||
{
|
||||
$units = array_filter(
|
||||
array_map(
|
||||
fn (int $id) => $this->geographicalUnitRepository->findSimpleGeographicalUnit($id),
|
||||
$this->geographicalUnitRepository->findSimpleGeographicalUnit(...),
|
||||
$formData['units'],
|
||||
),
|
||||
static fn (?SimpleGeographicalUnitDTO $unitDTO) => null !== $unitDTO,
|
||||
|
||||
@@ -24,7 +24,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
final readonly class CreatorFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
private const PREFIX = 'acpw_filter_creator';
|
||||
private const string PREFIX = 'acpw_filter_creator';
|
||||
|
||||
public function __construct(private UserRepositoryInterface $userRepository) {}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
final readonly class CreatorJobFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
private const PREFIX = 'acpw_filter_creator_job';
|
||||
private const string PREFIX = 'acpw_filter_creator_job';
|
||||
|
||||
public function __construct(
|
||||
private UserJobRepository $userJobRepository,
|
||||
|
||||
@@ -26,7 +26,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
class CreatorScopeFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
private const PREFIX = 'acpw_filter_creator_scope';
|
||||
private const string PREFIX = 'acpw_filter_creator_scope';
|
||||
|
||||
public function __construct(
|
||||
private readonly ScopeRepository $scopeRepository,
|
||||
|
||||
@@ -26,7 +26,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
final readonly class JobFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
private const PREFIX = 'acp_work_action_filter_user_job';
|
||||
private const string PREFIX = 'acp_work_action_filter_user_job';
|
||||
|
||||
public function __construct(
|
||||
private TranslatableStringHelperInterface $translatableStringHelper,
|
||||
|
||||
@@ -25,7 +25,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
final readonly class ReferrerFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
private const PREFIX = 'acpw_referrer_filter';
|
||||
private const string PREFIX = 'acpw_referrer_filter';
|
||||
|
||||
public function __construct(private RollingDateConverterInterface $rollingDateConverter, private UserRepositoryInterface $userRepository) {}
|
||||
|
||||
@@ -79,7 +79,7 @@ final readonly class ReferrerFilter implements FilterInterface
|
||||
{
|
||||
return [
|
||||
'accepted_agents' => $this->normalizeUserOrMe($formData['accepted_agents']),
|
||||
'agent_at' => array_key_exists('agent_at', $formData) ? $formData['agent_at']?->normalize() : (new RollingDate(RollingDate::T_TODAY))->normalize(),
|
||||
'agent_at' => array_key_exists('agent_at', $formData) ? $formData['agent_at']?->normalize() : new RollingDate(RollingDate::T_TODAY)->normalize(),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
final readonly class ScopeFilter implements FilterInterface
|
||||
{
|
||||
use \Chill\MainBundle\Export\ExportDataNormalizerTrait;
|
||||
private const PREFIX = 'acp_work_action_filter_user_scope';
|
||||
private const string PREFIX = 'acp_work_action_filter_user_scope';
|
||||
|
||||
public function __construct(
|
||||
private TranslatableStringHelper $translatableStringHelper,
|
||||
|
||||
@@ -35,7 +35,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
final readonly class ListAccompanyingPeriodHelper
|
||||
{
|
||||
public const FIELDS = [
|
||||
public const array FIELDS = [
|
||||
'acpId',
|
||||
'step',
|
||||
'stepSince',
|
||||
@@ -167,7 +167,7 @@ final readonly class ListAccompanyingPeriodHelper
|
||||
return implode(
|
||||
'|',
|
||||
array_map(
|
||||
fn ($s) => $this->translatableStringHelper->localize($s),
|
||||
$this->translatableStringHelper->localize(...),
|
||||
json_decode((string) $value, true, 512, JSON_THROW_ON_ERROR)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -38,7 +38,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
*/
|
||||
final readonly class ListPersonHelper
|
||||
{
|
||||
private const FIELDS = [
|
||||
private const array FIELDS = [
|
||||
'personId',
|
||||
'civility',
|
||||
'firstName',
|
||||
@@ -221,9 +221,8 @@ final readonly class ListPersonHelper
|
||||
|
||||
/**
|
||||
* @return array|string[]
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
#[\Deprecated]
|
||||
public function getAllPossibleFields(): array
|
||||
{
|
||||
return $this->getAllKeys();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user