mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-30 10:29:42 +00:00
Refactored code to use PHP8 attributes instead of annotations
In this change, Doctrine and validation annotations have been replaced with PHP8 Attributes. The Rector tool has been configured with a list of annotations to convert to attributes. As a consequence, the PHPStan's rules have been updated to reflect these changes. The PHP8's nullable operator (?) has been added where required, and comments in field declaration have been replaced with #[Attribute] syntax.
This commit is contained in:
@@ -53,17 +53,14 @@ use UnexpectedValueException;
|
||||
|
||||
/**
|
||||
* AccompanyingPeriod Class.
|
||||
*
|
||||
* @AccompanyingPeriodValidity(groups={AccompanyingPeriod::STEP_DRAFT, AccompanyingPeriod::STEP_CONFIRMED})
|
||||
*
|
||||
* @LocationValidity(groups={AccompanyingPeriod::STEP_DRAFT, AccompanyingPeriod::STEP_CONFIRMED})
|
||||
*
|
||||
* @ConfidentialCourseMustHaveReferrer(groups={AccompanyingPeriod::STEP_DRAFT, AccompanyingPeriod::STEP_CONFIRMED})
|
||||
*/
|
||||
#[DiscriminatorMap(typeProperty: 'type', mapping: ['accompanying_period' => AccompanyingPeriod::class])]
|
||||
#[Assert\GroupSequenceProvider]
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_person_accompanying_period')]
|
||||
#[AccompanyingPeriodValidity(groups: [AccompanyingPeriod::STEP_DRAFT, AccompanyingPeriod::STEP_CONFIRMED])]
|
||||
#[LocationValidity(groups: [AccompanyingPeriod::STEP_DRAFT, AccompanyingPeriod::STEP_CONFIRMED])]
|
||||
#[ConfidentialCourseMustHaveReferrer(groups: [AccompanyingPeriod::STEP_DRAFT, AccompanyingPeriod::STEP_CONFIRMED])]
|
||||
class AccompanyingPeriod implements
|
||||
GroupSequenceProviderInterface,
|
||||
HasCentersInterface,
|
||||
@@ -215,12 +212,11 @@ class AccompanyingPeriod implements
|
||||
private ?Origin $origin = null;
|
||||
|
||||
/**
|
||||
* @ParticipationOverlap(groups={AccompanyingPeriod::STEP_DRAFT, AccompanyingPeriod::STEP_CONFIRMED})
|
||||
*
|
||||
* @var Collection<AccompanyingPeriodParticipation>
|
||||
*/
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
#[ORM\OneToMany(targetEntity: AccompanyingPeriodParticipation::class, mappedBy: 'accompanyingPeriod', orphanRemoval: true, cascade: ['persist', 'refresh', 'remove', 'merge', 'detach'])]
|
||||
#[ParticipationOverlap(groups: [AccompanyingPeriod::STEP_DRAFT, AccompanyingPeriod::STEP_CONFIRMED])]
|
||||
private Collection $participations;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: Person::class, inversedBy: 'periodLocatedOn')]
|
||||
@@ -251,11 +247,10 @@ class AccompanyingPeriod implements
|
||||
|
||||
/**
|
||||
* @var Collection<resource>
|
||||
*
|
||||
* @ResourceDuplicateCheck(groups={AccompanyingPeriod::STEP_DRAFT, AccompanyingPeriod::STEP_CONFIRMED, "Default", "default"})
|
||||
*/
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
#[ORM\OneToMany(targetEntity: AccompanyingPeriod\Resource::class, mappedBy: 'accompanyingPeriod', cascade: ['persist', 'remove'], orphanRemoval: true)]
|
||||
#[ResourceDuplicateCheck(groups: [AccompanyingPeriod::STEP_DRAFT, AccompanyingPeriod::STEP_CONFIRMED, 'Default', 'default'])]
|
||||
private Collection $resources;
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user