Apply rector rules: add annotation for doctrine mapping

This commit is contained in:
2024-04-05 00:19:30 +02:00
parent 72016e1a21
commit a3f775a69b
23 changed files with 39 additions and 93 deletions

View File

@@ -136,12 +136,10 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\Location::class)]
private ?Location $location = null;
/**
* @Serializer\Context(normalizationContext={"read"}, groups={"calendar:light"})
*/
#[Serializer\Groups(['calendar:read', 'read', 'calendar:light', 'docgen:read'])]
#[Assert\NotNull(message: 'calendar.A main user is mandatory')]
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\User::class)]
#[Serializer\Context(normalizationContext: ['read'], groups: ['calendar:light'])]
private ?User $mainUser = null;
@@ -152,7 +150,6 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente
/**
*
*
* @Serializer\Context(normalizationContext={"read"}, groups={"calendar:light"})
*
* @var Collection<Person>
*/
@@ -160,6 +157,7 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente
#[Assert\Count(min: 1, minMessage: 'calendar.At least {{ limit }} person is required.')]
#[ORM\ManyToMany(targetEntity: \Chill\PersonBundle\Entity\Person::class, inversedBy: 'calendars')]
#[ORM\JoinTable(name: 'chill_calendar.calendar_to_persons')]
#[Serializer\Context(normalizationContext: ['read'], groups: ['calendar:light'])]
private Collection $persons;
#[Serializer\Groups(['calendar:read'])]
@@ -170,12 +168,11 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente
* @var Collection<ThirdParty>
*
*
*
* @Serializer\Context(normalizationContext={"read"}, groups={"calendar:light"})
*/
#[Serializer\Groups(['calendar:read', 'read', 'calendar:light', 'docgen:read'])]
#[ORM\ManyToMany(targetEntity: \Chill\ThirdPartyBundle\Entity\ThirdParty::class)]
#[ORM\JoinTable(name: 'chill_calendar.calendar_to_thirdparties')]
#[Serializer\Context(normalizationContext: ['read'], groups: ['calendar:light'])]
private Collection $professionals;
#[Serializer\Groups(['docgen:read'])]
@@ -185,19 +182,15 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => Calendar::SMS_PENDING])]
private string $smsStatus = self::SMS_PENDING;
/**
* @Serializer\Context(normalizationContext={"read"}, groups={"calendar:light"})
*/
#[Serializer\Groups(['calendar:read', 'read', 'calendar:light', 'docgen:read'])]
#[Assert\NotNull(message: 'calendar.A start date is required')]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: false)]
#[Serializer\Context(normalizationContext: ['read'], groups: ['calendar:light'])]
private ?\DateTimeImmutable $startDate = null;
/**
* @Serializer\Context(normalizationContext={"read"}, groups={"calendar:light"})
*/
#[Serializer\Groups(['calendar:read', 'read', 'calendar:light'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: false, options: ['default' => 'valid'])]
#[Serializer\Context(normalizationContext: ['read'], groups: ['calendar:light'])]
private string $status = self::STATUS_VALID;
#[Serializer\Groups(['docgen:read'])]