mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
Apply rector rules: symfony up to 54
This commit is contained in:
@@ -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 = '';
|
||||
|
||||
/**
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user