Apply rector rules: symfony up to 54

This commit is contained in:
2024-04-04 23:30:25 +02:00
parent 1ee3b9e2f0
commit 579bd829f8
204 changed files with 974 additions and 2346 deletions

View File

@@ -33,23 +33,16 @@ use Symfony\Component\Validator\Constraints as Assert;
* @ORM\Entity
*
* @ORM\Table(name="chill_person_accompanying_period_work")
*
* @Serializer\DiscriminatorMap(
* typeProperty="type",
* mapping={
* "accompanying_period_work": AccompanyingPeriodWork::class
* }
* )
*/
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['accompanying_period_work' => AccompanyingPeriodWork::class])]
class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterface, TrackCreationInterface, TrackUpdateInterface
{
/**
* @ORM\ManyToOne(targetEntity=AccompanyingPeriod::class)
*
* @Serializer\Groups({"read", "read:accompanyingPeriodWork:light"})
*
* @Serializer\Context(normalizationContext={"groups": {"read"}}, groups={"read:accompanyingPeriodWork:light"})
*/
#[Serializer\Groups(['read', 'read:accompanyingPeriodWork:light'])]
private ?AccompanyingPeriod $accompanyingPeriod = null;
/**
@@ -60,57 +53,46 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
* orphanRemoval=true
* )
*
* @Serializer\Groups({"read", "docgen:read"})
*
* @ORM\OrderBy({"startDate": "DESC", "id": "DESC"})
*
* @var Collection<AccompanyingPeriodWorkEvaluation>
*
* @internal /!\ the serialization for write evaluations is handled in `AccompanyingPeriodWorkDenormalizer`
*/
#[Serializer\Groups(['read', 'docgen:read'])]
private Collection $accompanyingPeriodWorkEvaluations;
/**
* @ORM\Column(type="datetime_immutable")
*
* @Serializer\Groups({"read", "docgen:read", "read:accompanyingPeriodWork:light"})
*/
#[Serializer\Groups(['read', 'docgen:read', 'read:accompanyingPeriodWork:light'])]
private ?\DateTimeImmutable $createdAt = null;
/**
* @ORM\Column(type="boolean")
*
* @Serializer\Groups({"read", "docgen:read", "read:accompanyingPeriodWork:light"})
*/
#[Serializer\Groups(['read', 'docgen:read', 'read:accompanyingPeriodWork:light'])]
private bool $createdAutomatically = false;
/**
* @ORM\Column(type="text")
*
* @Serializer\Groups({"read", "docgen:read", "read:accompanyingPeriodWork:light"})
*/
#[Serializer\Groups(['read', 'docgen:read', 'read:accompanyingPeriodWork:light'])]
private string $createdAutomaticallyReason = '';
/**
* @ORM\ManyToOne(targetEntity=User::class)
*
* @ORM\JoinColumn(nullable=false)
*
* @Serializer\Groups({"read", "docgen:read", "read:accompanyingPeriodWork:light"})
*/
#[Serializer\Groups(['read', 'docgen:read', 'read:accompanyingPeriodWork:light'])]
private ?User $createdBy = null;
/**
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
*
* @Serializer\Groups({"accompanying_period_work:create"})
* @Serializer\Groups({"accompanying_period_work:edit"})
* @Serializer\Groups({"read", "docgen:read", "read:accompanyingPeriodWork:light"})
*
* @Assert\GreaterThanOrEqual(propertyPath="startDate",
* message="accompanying_course_work.The endDate should be greater or equal than the start date"
* )
*/
#[Serializer\Groups(['accompanying_period_work:create', 'accompanying_period_work:edit', 'read', 'docgen:read', 'read:accompanyingPeriodWork:light'])]
#[Assert\GreaterThanOrEqual(propertyPath: 'startDate', message: 'accompanying_course_work.The endDate should be greater or equal than the start date')]
private ?\DateTimeImmutable $endDate = null;
/**
@@ -122,20 +104,14 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
* cascade={"persist"},
* orphanRemoval=true
* )
*
* @Serializer\Groups({"read", "docgen:read"})
* @Serializer\Groups({"accompanying_period_work:edit"})
*/
#[Serializer\Groups(['read', 'docgen:read', 'accompanying_period_work:edit'])]
private Collection $goals;
/**
* @ORM\ManyToOne(targetEntity=ThirdParty::class)
*
* @Serializer\Groups({"read", "docgen:read"})
* @Serializer\Groups({"accompanying_period_work:edit"})
*
* In schema : traitant
*/
#[Serializer\Groups(['read', 'docgen:read', 'accompanying_period_work:edit'])]
private ?ThirdParty $handlingThierParty = null;
/**
@@ -144,16 +120,14 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
* @ORM\GeneratedValue
*
* @ORM\Column(type="integer")
*
* @Serializer\Groups({"read", "docgen:read", "read:accompanyingPeriodWork:light", "read:evaluation:include-work"})
*/
#[Serializer\Groups(['read', 'docgen:read', 'read:accompanyingPeriodWork:light', 'read:evaluation:include-work'])]
private ?int $id = null;
/**
* @ORM\Column(type="text")
*
* @Serializer\Groups({"read", "accompanying_period_work:edit", "docgen:read"})
*/
#[Serializer\Groups(['read', 'accompanying_period_work:edit', 'docgen:read'])]
private string $note = '';
/**
@@ -162,18 +136,14 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
* @ORM\ManyToMany(targetEntity=Person::class)
*
* @ORM\JoinTable(name="chill_person_accompanying_period_work_person")
*
* @Serializer\Groups({"read", "docgen:read", "read:accompanyingPeriodWork:light"})
* @Serializer\Groups({"accompanying_period_work:edit"})
* @Serializer\Groups({"accompanying_period_work:create"})
*/
#[Serializer\Groups(['read', 'docgen:read', 'read:accompanyingPeriodWork:light', 'accompanying_period_work:edit', 'accompanying_period_work:create'])]
private Collection $persons;
/**
* @ORM\Embedded(class="Chill\MainBundle\Entity\Embeddable\PrivateCommentEmbeddable", columnPrefix="privateComment_")
*
* @Serializer\Groups({"read", "accompanying_period_work:edit"})
*/
#[Serializer\Groups(['read', 'accompanying_period_work:edit'])]
private PrivateCommentEmbeddable $privateComment;
/**
@@ -189,29 +159,22 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
* @ORM\ManyToMany(targetEntity=Result::class, inversedBy="accompanyingPeriodWorks")
*
* @ORM\JoinTable(name="chill_person_accompanying_period_work_result")
*
* @Serializer\Groups({"read", "docgen:read"})
* @Serializer\Groups({"accompanying_period_work:edit"})
*/
#[Serializer\Groups(['read', 'docgen:read', 'accompanying_period_work:edit'])]
private Collection $results;
/**
* @ORM\ManyToOne(targetEntity=SocialAction::class)
*
* @Serializer\Groups({"read", "docgen:read", "read:accompanyingPeriodWork:light"})
* @Serializer\Groups({"accompanying_period_work:create"})
*
* @Serializer\Context(normalizationContext={"groups": {"read"}}, groups={"read:accompanyingPeriodWork:light"})
*/
#[Serializer\Groups(['read', 'docgen:read', 'read:accompanyingPeriodWork:light', 'accompanying_period_work:create'])]
private ?SocialAction $socialAction = null;
/**
* @ORM\Column(type="date_immutable")
*
* @Serializer\Groups({"accompanying_period_work:create"})
* @Serializer\Groups({"accompanying_period_work:edit"})
* @Serializer\Groups({"read", "docgen:read", "read:accompanyingPeriodWork:light"})
*/
#[Serializer\Groups(['accompanying_period_work:create', 'accompanying_period_work:edit', 'read', 'docgen:read', 'read:accompanyingPeriodWork:light'])]
private ?\DateTimeImmutable $startDate = null;
/**
@@ -222,35 +185,30 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
* @ORM\JoinTable(name="chill_person_accompanying_period_work_third_party")
*
* In schema : intervenants
*
* @Serializer\Groups({"read", "docgen:read"})
* @Serializer\Groups({"accompanying_period_work:edit"})
*/
#[Serializer\Groups(['read', 'docgen:read', 'accompanying_period_work:edit'])]
private Collection $thirdParties;
/**
* @ORM\Column(type="datetime_immutable")
*
* @Serializer\Groups({"read", "docgen:read"})
*/
#[Serializer\Groups(['read', 'docgen:read'])]
private ?\DateTimeImmutable $updatedAt = null;
/**
* @ORM\ManyToOne(targetEntity=User::class)
*
* @ORM\JoinColumn(nullable=false)
*
* @Serializer\Groups({"read", "docgen:read"})
*/
#[Serializer\Groups(['read', 'docgen:read'])]
private ?User $updatedBy = null;
/**
* @ORM\Column(type="integer", nullable=false, options={"default": 1})
*
* @Serializer\Groups({"read", "accompanying_period_work:edit"})
*
* @ORM\Version
*/
#[Serializer\Groups(['read', 'accompanying_period_work:edit'])]
private int $version = 1;
public function __construct()
@@ -394,11 +352,8 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
/**
* @return ReadableCollection<int, User>
*
* @Serializer\Groups({"read", "docgen:read", "read:accompanyingPeriodWork:light"})
* @Serializer\Groups({"accompanying_period_work:edit"})
* @Serializer\Groups({"accompanying_period_work:create"})
*/
#[Serializer\Groups(['read', 'docgen:read', 'read:accompanyingPeriodWork:light', 'accompanying_period_work:edit', 'accompanying_period_work:create'])]
public function getReferrers(): ReadableCollection
{
$users = $this->referrersHistory