mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-12 01:54:41 +08:00
Updated to readonly public props on as many models as possible
This commit is contained in:
@@ -8,11 +8,13 @@ use Cake\Chronos\Chronos;
|
||||
|
||||
final class ApiKeyMeta
|
||||
{
|
||||
/**
|
||||
* @param RoleDefinition[] $roleDefinitions
|
||||
*/
|
||||
private function __construct(
|
||||
private ?string $name,
|
||||
private ?Chronos $expirationDate,
|
||||
/** @var RoleDefinition[] */
|
||||
private array $roleDefinitions,
|
||||
public readonly ?string $name,
|
||||
public readonly ?Chronos $expirationDate,
|
||||
public readonly array $roleDefinitions,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -35,22 +37,4 @@ final class ApiKeyMeta
|
||||
{
|
||||
return new self(null, null, $roleDefinitions);
|
||||
}
|
||||
|
||||
public function name(): ?string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function expirationDate(): ?Chronos
|
||||
{
|
||||
return $this->expirationDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return RoleDefinition[]
|
||||
*/
|
||||
public function roleDefinitions(): array
|
||||
{
|
||||
return $this->roleDefinitions;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user