mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Improve PHP types for extensability
This commit is contained in:
@@ -95,15 +95,12 @@ class Key
|
||||
* Decode the given secret key into a Key object, containing the project ID, type, role, scopes, and name.
|
||||
* Can be a stored API key or a dynamic key (JWT).
|
||||
*
|
||||
* @param Document $project
|
||||
* @param string $key
|
||||
* @return Key
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function decode(
|
||||
Document $project,
|
||||
string $key
|
||||
): Key {
|
||||
): static {
|
||||
if (\str_contains($key, '_')) {
|
||||
[$type, $secret] = \explode('_', $key, 2);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user