mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-10 01:03:13 +08:00
Migrate GenerateKeyCommand to symfony/console attributes
This commit is contained in:
@@ -14,6 +14,7 @@ use Shlinkio\Shlink\Rest\Entity\ApiKeyRole;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
/** @deprecated API key roles are deprecated */
|
||||
enum Role: string
|
||||
{
|
||||
case AUTHORED_SHORT_URLS = 'AUTHORED_SHORT_URLS';
|
||||
@@ -29,15 +30,6 @@ enum Role: string
|
||||
};
|
||||
}
|
||||
|
||||
public function paramName(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::AUTHORED_SHORT_URLS => 'author-only',
|
||||
self::DOMAIN_SPECIFIC => 'domain-only',
|
||||
self::NO_ORPHAN_VISITS => 'no-orphan-visits',
|
||||
};
|
||||
}
|
||||
|
||||
public static function toSpec(ApiKeyRole $role, string|null $context = null): Specification
|
||||
{
|
||||
return match ($role->role) {
|
||||
|
||||
Reference in New Issue
Block a user