mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-11 17:44:44 +08:00
Migrated all constructor props to property promotion when possible
This commit is contained in:
@@ -8,16 +8,12 @@ use Cake\Chronos\Chronos;
|
||||
|
||||
final class ApiKeyMeta
|
||||
{
|
||||
private ?string $name = null;
|
||||
private ?Chronos $expirationDate = null;
|
||||
/** @var RoleDefinition[] */
|
||||
private array $roleDefinitions;
|
||||
|
||||
private function __construct(?string $name, ?Chronos $expirationDate, array $roleDefinitions)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->expirationDate = $expirationDate;
|
||||
$this->roleDefinitions = $roleDefinitions;
|
||||
private function __construct(
|
||||
private ?string $name,
|
||||
private ?Chronos $expirationDate,
|
||||
/** @var RoleDefinition[] */
|
||||
private array $roleDefinitions,
|
||||
) {
|
||||
}
|
||||
|
||||
public static function withName(string $name): self
|
||||
|
||||
@@ -9,13 +9,8 @@ use Shlinkio\Shlink\Rest\ApiKey\Role;
|
||||
|
||||
final class RoleDefinition
|
||||
{
|
||||
private string $roleName;
|
||||
private array $meta;
|
||||
|
||||
private function __construct(string $roleName, array $meta)
|
||||
private function __construct(private string $roleName, private array $meta)
|
||||
{
|
||||
$this->roleName = $roleName;
|
||||
$this->meta = $meta;
|
||||
}
|
||||
|
||||
public static function forAuthoredShortUrls(): self
|
||||
|
||||
Reference in New Issue
Block a user