mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-27 17:15:02 +00:00
Apply rector rules: symfony up to 54
This commit is contained in:
@@ -28,11 +28,8 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table(name="chill_person_resource")
|
||||
*
|
||||
* @Serializer\DiscriminatorMap(typeProperty="type", mapping={
|
||||
* "personResource": personResource::class
|
||||
* })
|
||||
*/
|
||||
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['personResource' => PersonResource::class])]
|
||||
class PersonResource implements TrackCreationInterface, TrackUpdateInterface
|
||||
{
|
||||
use TrackCreationTrait;
|
||||
@@ -41,16 +38,14 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface
|
||||
|
||||
/**
|
||||
* @ORM\Embedded(class="Chill\MainBundle\Entity\Embeddable\CommentEmbeddable", columnPrefix="comment_")
|
||||
*
|
||||
* @Serializer\Groups({"read", "docgen:read"})
|
||||
*/
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
private CommentEmbeddable $comment;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", nullable=true)
|
||||
*
|
||||
* @Groups({"read", "docgen:read"})
|
||||
*/
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
private ?string $freeText = null;
|
||||
|
||||
/**
|
||||
@@ -59,18 +54,16 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface
|
||||
* @ORM\GeneratedValue
|
||||
*
|
||||
* @ORM\Column(type="integer")
|
||||
*
|
||||
* @Groups({"read", "docgen:read"})
|
||||
*/
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=PersonResourceKind::class, inversedBy="personResources")
|
||||
*
|
||||
* @ORM\JoinColumn(nullable=true)
|
||||
*
|
||||
* @Groups({"read", "docgen:read"})
|
||||
*/
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
private ?PersonResourceKind $kind = null;
|
||||
|
||||
/**
|
||||
@@ -79,9 +72,8 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface
|
||||
* @ORM\ManyToOne(targetEntity=Person::class)
|
||||
*
|
||||
* @ORM\JoinColumn(nullable=true)
|
||||
*
|
||||
* @Groups({"read", "docgen:read"})
|
||||
*/
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
private ?Person $person = null;
|
||||
|
||||
/**
|
||||
@@ -90,18 +82,16 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface
|
||||
* @ORM\ManyToOne(targetEntity=Person::class, inversedBy="resources")
|
||||
*
|
||||
* @ORM\JoinColumn(nullable=false)
|
||||
*
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
#[Groups(['read'])]
|
||||
private ?Person $personOwner = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=ThirdParty::class, inversedBy="personResources")
|
||||
*
|
||||
* @ORM\JoinColumn(nullable=true)
|
||||
*
|
||||
* @Groups({"read", "docgen:read"})
|
||||
*/
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
private ?ThirdParty $thirdParty = null;
|
||||
|
||||
public function __construct()
|
||||
@@ -142,9 +132,7 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface
|
||||
return $this->personOwner;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Groups({"read", "docgen:read"})
|
||||
*/
|
||||
#[Groups(['read', 'docgen:read'])]
|
||||
public function getResourceKind(): string
|
||||
{
|
||||
if ($this->getPerson() instanceof Person) {
|
||||
@@ -234,9 +222,7 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Assert\Callback
|
||||
*/
|
||||
#[Assert\Callback]
|
||||
public function validate(ExecutionContextInterface $context, mixed $payload)
|
||||
{
|
||||
if (null === $this->person && null === $this->thirdParty && (null === $this->freeText || '' === $this->freeText)) {
|
||||
|
@@ -27,9 +27,8 @@ class PersonResourceKind
|
||||
* @ORM\GeneratedValue
|
||||
*
|
||||
* @ORM\Column(type="integer")
|
||||
*
|
||||
* @Serializer\Groups({"docgen:read"})
|
||||
*/
|
||||
#[Serializer\Groups(['docgen:read'])]
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
@@ -40,10 +39,9 @@ class PersonResourceKind
|
||||
/**
|
||||
* @ORM\Column(type="json", length=255)
|
||||
*
|
||||
* @Serializer\Groups({"docgen:read"})
|
||||
*
|
||||
* @Serializer\Context({"is-translatable": true}, groups={"docgen:read"})
|
||||
*/
|
||||
#[Serializer\Groups(['docgen:read'])]
|
||||
private array $title;
|
||||
|
||||
public function getId(): ?int
|
||||
|
@@ -31,9 +31,8 @@ class ResidentialAddress
|
||||
* @ORM\ManyToOne(targetEntity=Address::class)
|
||||
*
|
||||
* @ORM\JoinColumn(nullable=true)
|
||||
*
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
#[Groups(['read'])]
|
||||
private ?Address $address = null;
|
||||
|
||||
/**
|
||||
@@ -43,9 +42,8 @@ class ResidentialAddress
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable", nullable=true)
|
||||
*
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
#[Groups(['read'])]
|
||||
private ?\DateTimeImmutable $endDate = null;
|
||||
|
||||
/**
|
||||
@@ -53,19 +51,17 @@ class ResidentialAddress
|
||||
*
|
||||
* @ORM\JoinColumn(nullable=true)
|
||||
*
|
||||
* @Groups({"read"})
|
||||
*
|
||||
* @Context(normalizationContext={"groups": {"minimal"}})
|
||||
*/
|
||||
#[Groups(['read'])]
|
||||
private ?Person $hostPerson = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=ThirdParty::class)
|
||||
*
|
||||
* @ORM\JoinColumn(nullable=true)
|
||||
*
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
#[Groups(['read'])]
|
||||
private ?ThirdParty $hostThirdParty = null;
|
||||
|
||||
/**
|
||||
@@ -86,9 +82,8 @@ class ResidentialAddress
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime_immutable")
|
||||
*
|
||||
* @Groups({"read"})
|
||||
*/
|
||||
#[Groups(['read'])]
|
||||
private ?\DateTimeImmutable $startDate = null;
|
||||
|
||||
public function __construct()
|
||||
|
Reference in New Issue
Block a user