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

@@ -54,13 +54,9 @@ class Document implements TrackCreationInterface, TrackUpdateInterface
* targetEntity="Chill\DocStoreBundle\Entity\StoredObject",
* cascade={"persist"}
* )
*
* @Assert\Valid
*
* @Assert\NotNull(
* message="Upload a document"
* )
*/
#[Assert\Valid]
#[Assert\NotNull(message: 'Upload a document')]
private ?StoredObject $object = null;
/**
@@ -70,11 +66,8 @@ class Document implements TrackCreationInterface, TrackUpdateInterface
/**
* @ORM\Column(type="text")
*
* @Assert\Length(
* min=2, max=250
* )
*/
#[Assert\Length(min: 2, max: 250)]
private string $title = '';
/**

View File

@@ -46,16 +46,14 @@ class StoredObject implements Document, TrackCreationInterface
/**
* @ORM\Column(type="json", name="datas")
*
* @Serializer\Groups({"read", "write"})
*/
#[Serializer\Groups(['read', 'write'])]
private array $datas = [];
/**
* @ORM\Column(type="text")
*
* @Serializer\Groups({"read", "write"})
*/
#[Serializer\Groups(['read', 'write'])]
private string $filename = '';
/**
@@ -64,46 +62,40 @@ class StoredObject implements Document, TrackCreationInterface
* @ORM\GeneratedValue
*
* @ORM\Column(type="integer")
*
* @Serializer\Groups({"read", "write"})
*/
#[Serializer\Groups(['read', 'write'])]
private ?int $id = null;
/**
* @var int[]
*
* @ORM\Column(type="json", name="iv")
*
* @Serializer\Groups({"read", "write"})
*/
#[Serializer\Groups(['read', 'write'])]
private array $iv = [];
/**
* @ORM\Column(type="json", name="key")
*
* @Serializer\Groups({"read", "write"})
*/
#[Serializer\Groups(['read', 'write'])]
private array $keyInfos = [];
/**
* @ORM\Column(type="text", name="title")
*
* @Serializer\Groups({"read", "write"})
*/
#[Serializer\Groups(['read', 'write'])]
private string $title = '';
/**
* @ORM\Column(type="text", name="type", options={"default": ""})
*
* @Serializer\Groups({"read", "write"})
*/
#[Serializer\Groups(['read', 'write'])]
private string $type = '';
/**
* @ORM\Column(type="uuid", unique=true)
*
* @Serializer\Groups({"read", "write"})
*/
#[Serializer\Groups(['read', 'write'])]
private UuidInterface $uuid;
/**
@@ -135,10 +127,9 @@ class StoredObject implements Document, TrackCreationInterface
* @param StoredObject::STATUS_* $status
*/
public function __construct(/**
* @ORM\Column(type="text", options={"default": "ready"})
*
* @Serializer\Groups({"read"})
*/
* @ORM\Column(type="text", options={"default": "ready"})
*/
#[Serializer\Groups(['read'])]
private string $status = 'ready'
) {
$this->uuid = Uuid::uuid4();
@@ -152,10 +143,9 @@ class StoredObject implements Document, TrackCreationInterface
}
/**
* @Serializer\Groups({"read", "write"})
*
* @deprecated
*/
#[Serializer\Groups(['read', 'write'])]
public function getCreationDate(): \DateTime
{
if (null === $this->createdAt) {
@@ -233,10 +223,9 @@ class StoredObject implements Document, TrackCreationInterface
}
/**
* @Serializer\Groups({"write"})
*
* @deprecated
*/
#[Serializer\Groups(['write'])]
public function setCreationDate(\DateTime $creationDate): self
{
$this->createdAt = \DateTimeImmutable::createFromMutable($creationDate);