apply more cs rules for php-cs

This commit is contained in:
2023-10-17 13:27:03 +02:00
parent 0b0cbed9db
commit bc2041cbdd
1485 changed files with 8169 additions and 9620 deletions

View File

@@ -17,8 +17,6 @@ use ChampsLibres\WopiLib\Contract\Entity\Document;
use Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate;
use Chill\MainBundle\Doctrine\Model\TrackCreationInterface;
use Chill\MainBundle\Doctrine\Model\TrackCreationTrait;
use DateTime;
use DateTimeInterface;
use Doctrine\ORM\Mapping as ORM;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\UuidInterface;
@@ -28,7 +26,9 @@ use Symfony\Component\Serializer\Annotation as Serializer;
* Represent a document stored in an object store.
*
* @ORM\Entity
*
* @ORM\Table("chill_doc.stored_object")
*
* @AsyncFileExists(
* message="The file is not stored properly"
* )
@@ -36,57 +36,68 @@ use Symfony\Component\Serializer\Annotation as Serializer;
class StoredObject implements AsyncFileInterface, Document, TrackCreationInterface
{
use TrackCreationTrait;
final public const STATUS_READY = "ready";
final public const STATUS_PENDING = "pending";
final public const STATUS_FAILURE = "failure";
final public const STATUS_READY = 'ready';
final public const STATUS_PENDING = 'pending';
final public const STATUS_FAILURE = 'failure';
/**
* @ORM\Column(type="json", name="datas")
*
* @Serializer\Groups({"read", "write"})
*/
private array $datas = [];
/**
* @ORM\Column(type="text")
*
* @Serializer\Groups({"read", "write"})
*/
private string $filename = '';
/**
* @ORM\Id
*
* @ORM\GeneratedValue
*
* @ORM\Column(type="integer")
*
* @Serializer\Groups({"read", "write"})
*/
private ?int $id = null;
/**
* @var int[]
*
* @ORM\Column(type="json", name="iv")
*
* @Serializer\Groups({"read", "write"})
*/
private array $iv = [];
/**
* @ORM\Column(type="json", name="key")
*
* @Serializer\Groups({"read", "write"})
*/
private array $keyInfos = [];
/**
* @ORM\Column(type="text", name="title")
*
* @Serializer\Groups({"read", "write"})
*/
private string $title = '';
/**
* @ORM\Column(type="text", name="type", options={"default": ""})
*
* @Serializer\Groups({"read", "write"})
*/
private string $type = '';
/**
* @ORM\Column(type="uuid", unique=true)
*
* @Serializer\Groups({"read", "write"})
*/
private UuidInterface $uuid;
@@ -111,27 +122,29 @@ class StoredObject implements AsyncFileInterface, Document, TrackCreationInterfa
*/
public function __construct(/**
* @ORM\Column(type="text", options={"default": "ready"})
*
* @Serializer\Groups({"read"})
*/
private string $status = "ready"
private string $status = 'ready'
) {
$this->uuid = Uuid::uuid4();
}
public function addGenerationTrial(): self
{
$this->generationTrialsCounter++;
++$this->generationTrialsCounter;
return $this;
}
/**
* @Serializer\Groups({"read", "write"})
*
* @deprecated
*/
public function getCreationDate(): DateTime
public function getCreationDate(): \DateTime
{
return DateTime::createFromImmutable($this->createdAt);
return \DateTime::createFromImmutable($this->createdAt);
}
public function getDatas(): array
@@ -165,7 +178,7 @@ class StoredObject implements AsyncFileInterface, Document, TrackCreationInterfa
}
/**
* @deprecated Use method "getFilename()".
* @deprecated use method "getFilename()"
*/
public function getObjectName()
{
@@ -202,9 +215,10 @@ class StoredObject implements AsyncFileInterface, Document, TrackCreationInterfa
/**
* @Serializer\Groups({"write"})
*
* @deprecated
*/
public function setCreationDate(DateTime $creationDate): self
public function setCreationDate(\DateTime $creationDate): self
{
$this->createdAt = \DateTimeImmutable::createFromMutable($creationDate);
@@ -276,6 +290,7 @@ class StoredObject implements AsyncFileInterface, Document, TrackCreationInterfa
public function setTemplate(?DocGeneratorTemplate $template): StoredObject
{
$this->template = $template;
return $this;
}