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

@@ -18,9 +18,8 @@ class AdminController extends AbstractController
{
/**
* ThirdParty admin.
*
* @Route("/{_locale}/admin/thirdparty", name="chill_thirdparty_admin_index")
*/
#[Route(path: '/{_locale}/admin/thirdparty', name: 'chill_thirdparty_admin_index')]
public function indexAdminAction()
{
return $this->render('@ChillThirdParty/Admin/index.html.twig');

View File

@@ -92,11 +92,9 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
* [fr] Sigle.
*
* @ORM\Column(name="acronym", type="string", length=64, nullable=true)
*
* @Assert\Length(min="2")
*
* @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"})
*/
#[Assert\Length(min: 2)]
#[Groups(['read', 'write', 'docgen:read', 'docgen:read:3party:parent'])]
private ?string $acronym = '';
/**
@@ -112,10 +110,9 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
*
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
*
* @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"})
*
* @Context(normalizationContext={"groups": "docgen:read"}, groups={"docgen:read:3party:parent"})
*/
#[Groups(['read', 'write', 'docgen:read', 'docgen:read:3party:parent'])]
private ?Address $address = null;
/**
@@ -136,10 +133,9 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
* joinColumns={@ORM\JoinColumn(name="thirdparty_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="category_id", referencedColumnName="id")})
*
* @Groups({"docgen:read", "docgen:read:3party:parent"})
*
* @Context(normalizationContext={"groups": "docgen:read"}, groups={"docgen:read:3party:parent"})
*/
#[Groups(['docgen:read', 'docgen:read:3party:parent'])]
private Collection $categories;
/**
@@ -158,33 +154,29 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
* cascade={"persist"}, orphanRemoval=true)
*
* @var Collection<ThirdParty>
*
* @Assert\Valid(traverse=true)
*/
#[Assert\Valid(traverse: true)]
private Collection $children;
/**
* @ORM\ManyToOne(targetEntity=Civility::class)
* ORM\JoinColumn(name="civility", referencedColumnName="id", nullable=true)
*
* @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"})
*
* @Context(normalizationContext={"groups": "docgen:read"}, groups={"docgen:read:3party:parent"})
*/
#[Groups(['read', 'write', 'docgen:read', 'docgen:read:3party:parent'])]
private ?Civility $civility = null;
/**
* @ORM\Column(name="comment", type="text", nullable=true)
*
* @Groups({"read", "write"})
*/
#[Groups(['read', 'write'])]
private ?string $comment = null;
/**
* @ORM\Column(name="contact_data_anonymous", type="boolean", options={"default": false})
*
* @Groups({"read", "docgen:read", "docgen:read:3party:parent"})
*/
#[Groups(['read', 'docgen:read', 'docgen:read:3party:parent'])]
private bool $contactDataAnonymous = false;
/**
@@ -201,18 +193,15 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
/**
* @ORM\Column(name="email", type="string", length=255, nullable=true)
*
* @Assert\Email()
*
* @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"})
*/
#[Assert\Email]
#[Groups(['read', 'write', 'docgen:read', 'docgen:read:3party:parent'])]
private ?string $email = null;
/**
* @ORM\Column(name="firstname", type="text", options={"default": ""})
*
* @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"})
*/
#[Groups(['read', 'write', 'docgen:read', 'docgen:read:3party:parent'])]
private ?string $firstname = '';
/**
@@ -221,40 +210,32 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
* @ORM\Id
*
* @ORM\GeneratedValue(strategy="AUTO")
*
* @Groups({"read", "docgen:read", "docgen:read:3party:parent"})
*/
#[Groups(['read', 'docgen:read', 'docgen:read:3party:parent'])]
private ?int $id = null;
/**
* @ORM\Column(name="kind", type="string", length="20", options={"default": ""})
*
* @Groups({"write", "docgen:read", "docgen:read:3party:parent"})
*/
#[Groups(['write', 'docgen:read', 'docgen:read:3party:parent'])]
private string $kind = '';
/**
* @ORM\Column(name="name", type="string", length=255)
*
* @Assert\Length(min="2")
*
* @Assert\NotNull
*
* @Assert\NotBlank
*
* @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"})
*/
#[Assert\Length(min: 2)]
#[Assert\NotNull]
#[Assert\NotBlank]
#[Groups(['read', 'write', 'docgen:read', 'docgen:read:3party:parent'])]
private string $name = '';
/**
* [fr] Raison sociale.
*
* @ORM\Column(name="name_company", type="string", length=255, nullable=true)
*
* @Assert\Length(min="3")
*
* @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"})
*/
#[Assert\Length(min: 3)]
#[Groups(['read', 'write', 'docgen:read', 'docgen:read:3party:parent'])]
private ?string $nameCompany = '';
/**
@@ -264,10 +245,9 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
*
* @ORM\JoinColumn(name="parent_id", referencedColumnName="id")
*
* @Groups({"read", "write", "docgen:read"})
*
* @Context(normalizationContext={"groups": "docgen:read:3party:parent"}, groups={"docgen:read"})
*/
#[Groups(['read', 'write', 'docgen:read'])]
private ?ThirdParty $parent = null;
/**
@@ -275,19 +255,17 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
*
* @ORM\Column(name="profession", type="text", nullable=false)
*
* @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"})
*
* @Context(normalizationContext={"groups": "docgen:read"}, groups={"docgen:read:3party:parent"})
*/
#[Groups(['read', 'write', 'docgen:read', 'docgen:read:3party:parent'])]
private string $profession = '';
/**
* @ORM\Column(name="telephone", type="phone_number", nullable=true)
*
* @PhonenumberConstraint(type="any")
*
* @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"})
*/
#[Groups(['read', 'write', 'docgen:read', 'docgen:read:3party:parent'])]
private ?PhoneNumber $telephone = null;
/**
@@ -546,9 +524,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
return $this->updatedBy;
}
/**
* @Groups({"read", "docgen:read", "docgen:read:3party:parent"})
*/
#[Groups(['read', 'docgen:read', 'docgen:read:3party:parent'])]
public function isChild(): bool
{
return null !== $this->parent;

View File

@@ -33,16 +33,14 @@ class ThirdPartyCategory
* @ORM\GeneratedValue
*
* @ORM\Column(type="integer")
*
* @Serializer\Groups({"docgen:read"})
*/
#[Serializer\Groups(['docgen:read'])]
private ?int $id = null;
/**
* @ORM\Column(type="json")
*
* @Serializer\Groups({"docgen:read"})
*/
#[Serializer\Groups(['docgen:read'])]
private array $name = [];
public function getActive(): ?bool

View File

@@ -19,17 +19,14 @@ use Symfony\Component\Serializer\Annotation as Serializer;
* @ORM\Table(name="chill_3party.party_profession")
*
* @ORM\Entity(repositoryClass=ThirdPartyProfessionRepository::class)
*
* @Serializer\DiscriminatorMap(typeProperty="type", mapping={
* "third_party_profession": ThirdPartyProfession::class})
*/
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['third_party_profession' => ThirdPartyProfession::class])]
class ThirdPartyProfession
{
/**
* @ORM\Column(type="boolean")
*
* @Serializer\Groups({"read"})
*/
#[Serializer\Groups(['read'])]
private bool $active = true;
/**
@@ -38,16 +35,14 @@ class ThirdPartyProfession
* @ORM\GeneratedValue
*
* @ORM\Column(type="integer")
*
* @Serializer\Groups({"docgen:read", "read", "write"})
*/
#[Serializer\Groups(['docgen:read', 'read', 'write'])]
private ?int $id = null;
/**
* @ORM\Column(type="json")
*
* @Serializer\Groups({"docgen:read", "read"})
*/
#[Serializer\Groups(['docgen:read', 'read'])]
private array $name = [];
public function getActive(): ?bool