Skip to content

Commit

Permalink
ref: yet another rector just before 6.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
theus77 committed Jan 2, 2024
1 parent 77d1ba2 commit e01df26
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 37 deletions.
2 changes: 1 addition & 1 deletion EMS/common-bundle/src/Entity/StoreData.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class StoreData
{
use CreatedModifiedTrait;

private UuidInterface $id;
private readonly UuidInterface $id;
private string $key;
/** @var array<mixed> */
protected array $data = [];
Expand Down
16 changes: 8 additions & 8 deletions EMS/common-bundle/src/Service/Pdf/PdfPrintOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ class PdfPrintOptions
private readonly string $size;
private readonly ?string $chroot;

public const FILENAME = 'filename';
public const ATTACHMENT = 'attachment';
public const COMPRESS = 'compress';
public const HTML5_PARSING = 'html5Parsing';
public const PHP_ENABLED = 'phpEnabled';
public const ORIENTATION = 'orientation';
public const SIZE = 'size';
public const CHROOT = 'chroot';
final public const FILENAME = 'filename';
final public const ATTACHMENT = 'attachment';
final public const COMPRESS = 'compress';
final public const HTML5_PARSING = 'html5Parsing';
final public const PHP_ENABLED = 'phpEnabled';
final public const ORIENTATION = 'orientation';
final public const SIZE = 'size';
final public const CHROOT = 'chroot';

/**
* @param array<string, mixed> $options
Expand Down
2 changes: 1 addition & 1 deletion EMS/core-bundle/src/Entity/Channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Channel extends JsonDeserializer implements \JsonSerializable, EntityInter
{
use CreatedModifiedTrait;

private UuidInterface $id;
private readonly UuidInterface $id;
protected string $name = '';
/** @var string */
protected $alias;
Expand Down
2 changes: 1 addition & 1 deletion EMS/core-bundle/src/Entity/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Dashboard extends JsonDeserializer implements \JsonSerializable, EntityInt
{
use CreatedModifiedTrait;

private UuidInterface $id;
private readonly UuidInterface $id;
protected string $name;
protected string $icon;
protected string $label;
Expand Down
2 changes: 1 addition & 1 deletion EMS/core-bundle/src/Entity/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Form extends JsonDeserializer implements \JsonSerializable, EntityInterfac
{
use CreatedModifiedTrait;

private UuidInterface $id;
private readonly UuidInterface $id;
protected string $name;
protected string $label;
protected int $orderKey;
Expand Down
8 changes: 4 additions & 4 deletions EMS/core-bundle/src/Entity/FormVerification.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@

class FormVerification
{
private UuidInterface $id;
private readonly UuidInterface $id;

private string $code;
private \DateTimeImmutable $created;
private readonly string $code;
private readonly \DateTimeImmutable $created;
private \DateTimeImmutable $expirationDate;

private const EXPIRATION_TIME = '+3 hours';

public function __construct(private string $value)
public function __construct(private readonly string $value)
{
$now = new \DateTimeImmutable();

Expand Down
2 changes: 1 addition & 1 deletion EMS/core-bundle/src/Entity/QuerySearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class QuerySearch extends JsonDeserializer implements \JsonSerializable, EntityI
{
use CreatedModifiedTrait;

private UuidInterface $id;
private readonly UuidInterface $id;
protected string $label;
protected string $name = '';
/** @var Collection <int,Environment> */
Expand Down
6 changes: 2 additions & 4 deletions EMS/core-bundle/src/Entity/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Task implements EntityInterface
{
use CreatedModifiedTrait;

private UuidInterface $id;
private readonly UuidInterface $id;
private string $title;
private string $status = self::STATUS_PLANNED;
private int $delay;
Expand All @@ -26,7 +26,6 @@ class Task implements EntityInterface
private ?string $description = null;
/** @var array<mixed> */
private array $logs;
private string $createdBy;

final public const STATUS_PROGRESS = 'progress';
final public const STATUS_PLANNED = 'planned';
Expand All @@ -42,12 +41,11 @@ class Task implements EntityInterface
self::STATUS_APPROVED => ['icon' => 'fa fa-check', 'bg' => 'green', 'text' => 'success', 'label' => 'success'],
];

public function __construct(string $username)
public function __construct(private string $createdBy)
{
$this->id = Uuid::uuid4();
$this->created = DateTime::create('now');
$this->modified = DateTime::create('now');
$this->createdBy = $username;
}

public function addLog(TaskLog $taskLog): void
Expand Down
2 changes: 1 addition & 1 deletion EMS/core-bundle/src/Entity/WysiwygStylesSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class WysiwygStylesSet extends JsonDeserializer implements \JsonSerializable, En
protected ?string $contentCss = null;
protected ?string $contentJs = null;
/** @var ?array<string, mixed> */
protected ?array $assets;
protected ?array $assets = null;
protected ?string $saveDir = null;

public function __construct()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ public function down(Schema $schema): void
while ($userRow = $userRoles->fetchAssociative()) {
$this->addSql('UPDATE user SET roles = :roles WHERE id = :id', [
'id' => $userRow['id'],
'roles' => \serialize(\json_decode($userRow['roles'])),
'roles' => \serialize(\json_decode((string) $userRow['roles'])),
]);
}

$uploadAssets = $this->connection->executeQuery('select id, head_in from uploaded_asset where head_in is not null');
while ($uploadAsset = $uploadAssets->fetchAssociative()) {
$this->addSql('UPDATE uploaded_asset SET head_in = :head_in WHERE id = :id', [
'id' => $uploadAsset['id'],
'head_in' => \serialize(\json_decode($uploadAsset['head_in'])),
'head_in' => \serialize(\json_decode((string) $uploadAsset['head_in'])),
]);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ public function down(Schema $schema): void
while ($userRow = $userRoles->fetchAssociative()) {
$this->addSql('UPDATE "user" SET roles = :roles WHERE id = :id', [
'id' => $userRow['id'],
'roles' => \serialize(\json_decode($userRow['roles'])),
'roles' => \serialize(\json_decode((string) $userRow['roles'])),
]);
}

$uploadAssets = $this->connection->executeQuery('select id, head_in from uploaded_asset where head_in is not null');
while ($uploadAsset = $uploadAssets->fetchAssociative()) {
$this->addSql('UPDATE uploaded_asset SET head_in = :head_in WHERE id = :id', [
'id' => $uploadAsset['id'],
'head_in' => \serialize(\json_decode($uploadAsset['head_in'])),
'head_in' => \serialize(\json_decode((string) $uploadAsset['head_in'])),
]);
}
}
Expand Down
12 changes: 6 additions & 6 deletions EMS/submission-bundle/src/Entity/FormSubmission.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ class FormSubmission implements EntityInterface
{
use CreatedModifiedTrait;

private UuidInterface $id;
private string $name;
private string $instance;
private string $locale;
private readonly UuidInterface $id;
private readonly string $name;
private readonly string $instance;
private readonly string $locale;

/** @var array<string, mixed>|null */
private ?array $data;
/** @var Collection<int, FormSubmissionFile> */
protected Collection $files;

private ?\DateTime $expireDate;
private string $label;
private readonly ?\DateTime $expireDate;
private readonly string $label;
private int $processTryCounter = 0;
private ?string $processId = null;
private ?string $processBy = null;
Expand Down
10 changes: 5 additions & 5 deletions EMS/submission-bundle/src/Entity/FormSubmissionFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ class FormSubmissionFile implements EntityInterface
{
use CreatedModifiedTrait;

private UuidInterface $id;
private readonly UuidInterface $id;
/** @var string|resource */
private $file;
private string $filename;
private string $formField;
private string $mimeType;
private string $size;
private readonly string $filename;
private readonly string $formField;
private readonly string $mimeType;
private readonly string $size;

/**
* @param array<string, string> $file
Expand Down

0 comments on commit e01df26

Please sign in to comment.