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

@@ -35,11 +35,9 @@ use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Table(name: 'chill_person_accompanying_period_work')]
class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterface, TrackCreationInterface, TrackUpdateInterface
{
/**
* @Serializer\Context(normalizationContext={"groups": {"read"}}, groups={"read:accompanyingPeriodWork:light"})
*/
#[Serializer\Groups(['read', 'read:accompanyingPeriodWork:light'])]
#[ORM\ManyToOne(targetEntity: AccompanyingPeriod::class)]
#[Serializer\Context(normalizationContext: ['groups' => ['read']], groups: ['read:accompanyingPeriodWork:light'])]
private ?AccompanyingPeriod $accompanyingPeriod = null;
/**
@@ -129,11 +127,9 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
#[ORM\JoinTable(name: 'chill_person_accompanying_period_work_result')]
private Collection $results;
/**
* @Serializer\Context(normalizationContext={"groups": {"read"}}, groups={"read:accompanyingPeriodWork:light"})
*/
#[Serializer\Groups(['read', 'docgen:read', 'read:accompanyingPeriodWork:light', 'accompanying_period_work:create'])]
#[ORM\ManyToOne(targetEntity: SocialAction::class)]
#[Serializer\Context(normalizationContext: ['groups' => ['read']], groups: ['read:accompanyingPeriodWork:light'])]
private ?SocialAction $socialAction = null;
#[Serializer\Groups(['accompanying_period_work:create', 'accompanying_period_work:edit', 'read', 'docgen:read', 'read:accompanyingPeriodWork:light'])]

View File

@@ -27,11 +27,9 @@ use Symfony\Component\Serializer\Annotation as Serializer;
#[ORM\Table('chill_person_accompanying_period_work_evaluation')]
class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackUpdateInterface
{
/**
* @Serializer\Context(normalizationContext={"groups": {"read:accompanyingPeriodWork:light"}}, groups={"read:evaluation:include-work"})
*/
#[Serializer\Groups(['read:evaluation:include-work'])]
#[ORM\ManyToOne(targetEntity: AccompanyingPeriodWork::class, inversedBy: 'accompanyingPeriodWorkEvaluations')]
#[Serializer\Context(normalizationContext: ['groups' => ['read:accompanyingPeriodWork:light']], groups: ['read:evaluation:include-work'])]
private ?AccompanyingPeriodWork $accompanyingPeriodWork = null;
#[Serializer\Groups(['read', 'docgen:read', 'write', 'accompanying_period_work_evaluation:create'])]

View File

@@ -43,11 +43,9 @@ class ClosingMotive
#[ORM\GeneratedValue(strategy: 'AUTO')]
private ?int $id = null;
/**
* @Serializer\Context({"is-translatable": true}, groups={"docgen:read"})
*/
#[Serializer\Groups(['docgen:read'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
#[Serializer\Context(['is-translatable' => true], groups: ['docgen:read'])]
private array $name = [];
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT)]

View File

@@ -27,11 +27,9 @@ class Origin
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
private ?int $id = null;
/**
* @Serializer\Context({"is-translatable": true}, groups={"docgen:read"})
*/
#[Serializer\Groups(['read', 'docgen:read'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
#[Serializer\Context(['is-translatable' => true], groups: ['docgen:read'])]
private array $label = [];
#[Serializer\Groups(['read'])]

View File

@@ -30,11 +30,9 @@ class HouseholdCompositionType
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
private ?int $id = null;
/**
* @Serializer\Context({"is-translatable": true}, groups={"docgen:read"})
*/
#[Serializer\Groups(['read', 'docgen:read'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
#[Serializer\Context(['is-translatable' => true], groups: ['docgen:read'])]
private array $label = [];
public function getId(): ?int

View File

@@ -46,13 +46,11 @@ class HouseholdMember
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
private ?int $id = null;
/**
* @Serializer\Context({"docgen:person:with-household": false})
*/
#[Serializer\Groups(['read', 'docgen:read'])]
#[Assert\Valid(groups: ['household_memberships'])]
#[Assert\NotNull(groups: ['household_memberships'])]
#[ORM\ManyToOne(targetEntity: Person::class)]
#[Serializer\Context(['docgen:person:with-household' => false])]
private ?Person $person = null;
#[Serializer\Groups(['read', 'docgen:read'])]

View File

@@ -31,11 +31,9 @@ class Position
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
private ?int $id = null;
/**
* @Serializer\Context({"is-translatable": true}, groups={"docgen:read"})
*/
#[Serializer\Groups(['read', 'docgen:read'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
#[Serializer\Context(['is-translatable' => true], groups: ['docgen:read'])]
private array $label = [];
#[Serializer\Groups(['read'])]

View File

@@ -29,11 +29,9 @@ class PersonResourceKind
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
private bool $isActive = true;
/**
* @Serializer\Context({"is-translatable": true}, groups={"docgen:read"})
*/
#[Serializer\Groups(['docgen:read'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, length: 255)]
#[Serializer\Context(['is-translatable' => true], groups: ['docgen:read'])]
private array $title;
public function getId(): ?int

View File

@@ -38,14 +38,11 @@ class ResidentialAddress
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true)]
private ?\DateTimeImmutable $endDate = null;
/**
*
*
* @Context(normalizationContext={"groups": {"minimal"}})
*/
#[Groups(['read'])]
#[ORM\ManyToOne(targetEntity: Person::class)]
#[ORM\JoinColumn(nullable: true)]
#[Context(normalizationContext: ['groups' => ['minimal']])]
private ?Person $hostPerson = null;

View File

@@ -32,18 +32,14 @@ class Relation
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, nullable: true)]
private bool $isActive = true;
/**
* @Serializer\Context({"is-translatable": true}, groups={"docgen:read"})
*/
#[Serializer\Groups(['read'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, nullable: true)]
#[Serializer\Context(['is-translatable' => true], groups: ['docgen:read'])]
private array $reverseTitle = [];
/**
* @Serializer\Context({"is-translatable": true}, groups={"docgen:read"})
*/
#[Serializer\Groups(['read'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, nullable: true)]
#[Serializer\Context(['is-translatable' => true], groups: ['docgen:read'])]
private array $title = [];
public function getId(): ?int

View File

@@ -47,11 +47,9 @@ class Evaluation
#[ORM\ManyToMany(targetEntity: SocialAction::class, mappedBy: 'evaluations')]
private Collection $socialActions;
/**
* @Serializer\Context({"is-translatable": true}, groups={"docgen:read"})
*/
#[Serializer\Groups(['read', 'docgen:read'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
#[Serializer\Context(['is-translatable' => true], groups: ['docgen:read'])]
private array $title = [];
#[Serializer\Groups(['read', 'docgen:read'])]

View File

@@ -47,11 +47,9 @@ class Goal
#[ORM\ManyToMany(targetEntity: SocialAction::class, mappedBy: 'goals')]
private Collection $socialActions;
/**
* @Serializer\Context({"is-translatable": true}, groups={"docgen:read"})
*/
#[Serializer\Groups(['read', 'docgen:read'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
#[Serializer\Context(['is-translatable' => true], groups: ['docgen:read'])]
private array $title = [];
public function __construct()

View File

@@ -59,11 +59,9 @@ class Result
#[ORM\ManyToMany(targetEntity: SocialAction::class, mappedBy: 'results')]
private Collection $socialActions;
/**
* @Serializer\Context({"is-translatable": true}, groups={"docgen:read"})
*/
#[Serializer\Groups(['read', 'docgen:read'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
#[Serializer\Context(['is-translatable' => true], groups: ['docgen:read'])]
private array $title = [];
public function __construct()