Skip to content

Commit f15033c

Browse files
committed
hotfix: constants in traits are not supported in php 7.4
1 parent 6f32e31 commit f15033c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

app/traits/HasTokenManagement.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ trait HasTokenManagement
44
{
55
use HasEncryption;
66

7-
private const VALID_TOKEN_TYPES = ['public', 'admin', 'user'];
7+
private array $validTokenTypes = ['public', 'admin', 'user'];
88

99
/**
1010
* Sanitizes an API token to ensure it matches the expected format.
@@ -89,7 +89,7 @@ public function clearTokens(): void
8989
*/
9090
protected function validateTokenType(string $type): string
9191
{
92-
return in_array($type, self::VALID_TOKEN_TYPES, true) ? $type : 'public';
92+
return in_array($type, $this->validTokenTypes, true) ? $type : 'public';
9393
}
9494

9595
/**

0 commit comments

Comments
 (0)