refactor: add explicit types to class constants (PHP 8.3+)
This commit is contained in:
parent
13091c4ec6
commit
0c25d663f8
9 changed files with 10 additions and 9 deletions
|
|
@ -8,7 +8,7 @@ use Shared\DDD\EntityId;
|
|||
|
||||
final readonly class ArcadiaEmployeeId extends EntityId
|
||||
{
|
||||
private const PATTERN = '/^\d{7,8}$/';
|
||||
private const string PATTERN = '/^\d{7,8}$/';
|
||||
|
||||
public function __construct(
|
||||
public readonly string $value
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ namespace Domain\Models\ValueObjects;
|
|||
|
||||
final readonly class EstablishmentCode
|
||||
{
|
||||
private const PATTERN = '/^[\dA-Z]{2,}$/';
|
||||
private const string PATTERN = '/^[\dA-Z]{2,}$/';
|
||||
|
||||
public function __construct(
|
||||
public readonly string $value
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ use Shared\DDD\EntityId;
|
|||
|
||||
final readonly class IncoCompositionId extends EntityId
|
||||
{
|
||||
private const PATTERN = '/^\d{1,}$/';
|
||||
private const string PATTERN = '/^\d{1,}$/';
|
||||
|
||||
public function __construct(
|
||||
public readonly string $value
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ use Shared\DDD\EntityId;
|
|||
|
||||
final readonly class IncoId extends EntityId
|
||||
{
|
||||
private const PATTERN = '/^\d{1,}$/';
|
||||
private const string PATTERN = '/^\d{1,}$/';
|
||||
|
||||
public function __construct(
|
||||
public readonly string $value
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ final readonly class PortionAmount
|
|||
/**
|
||||
* The number of decimals allowed, this should not change
|
||||
*/
|
||||
private const ALLOWED_DECIMAL_SIZE = 2;
|
||||
private const int ALLOWED_DECIMAL_SIZE = 2;
|
||||
|
||||
/**
|
||||
* NbPortion
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace Domain\Models\ValueObjects;
|
|||
*/
|
||||
final readonly class ServiceId
|
||||
{
|
||||
private const PATTERN = '/^\d{1,}$/';
|
||||
private const string PATTERN = '/^\d{1,}$/';
|
||||
|
||||
public function __construct(
|
||||
public readonly string $value
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace Domain\Models\ValueObjects;
|
|||
*/
|
||||
final readonly class SiteId
|
||||
{
|
||||
private const PATTERN = '/^[A-Z]{2,}$/';
|
||||
private const string PATTERN = '/^[A-Z]{2,}$/';
|
||||
|
||||
public function __construct(
|
||||
public readonly string $value
|
||||
|
|
|
|||
|
|
@ -18,7 +18,8 @@ use Shared\Pagination;
|
|||
|
||||
final class EloquentIncoShortSheetDirectory implements IncoShortSheetDirectory
|
||||
{
|
||||
private const SHORT_FIELDS = ['id', 'name', 'label', 'created_at', 'updated_at'];
|
||||
/** @var list<string> */
|
||||
private const array SHORT_FIELDS = ['id', 'name', 'label', 'created_at', 'updated_at'];
|
||||
|
||||
#[\Override]
|
||||
public function findAll(
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace Shared;
|
|||
final readonly class Pagination
|
||||
{
|
||||
/** ERR_TOO_MANY_RECORDS fixed to 10k */
|
||||
public const MAX_PAGE_SIZE = 10000;
|
||||
public const int MAX_PAGE_SIZE = 10000;
|
||||
|
||||
public function __construct(
|
||||
private int $from,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue