Skip to content

Commit 2a7e28e

Browse files
formatting
1 parent 2c05643 commit 2a7e28e

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

src/Client.php

+10-16
Original file line numberDiff line numberDiff line change
@@ -148,26 +148,20 @@ protected function redirectUris(): Attribute
148148
}
149149

150150
/**
151-
* Get the client's grant types.
151+
* Interact with the client's grant types.
152152
*/
153153
protected function grantTypes(): Attribute
154154
{
155155
return Attribute::make(
156-
get: function (?string $value, array $attributes) {
157-
if (isset($value)) {
158-
return $this->fromJson($value);
159-
}
160-
161-
return array_keys(array_filter([
162-
'authorization_code' => ! empty($this->redirect_uris),
163-
'client_credentials' => $this->confidential() && $this->firstParty(),
164-
'implicit' => ! empty($this->redirect_uris),
165-
'password' => $this->password_client,
166-
'personal_access' => $this->personal_access_client,
167-
'refresh_token' => true,
168-
'urn:ietf:params:oauth:grant-type:device_code' => true,
169-
]));
170-
},
156+
get: fn (?string $value): array => isset($value) ? $this->fromJson($value) : array_keys(array_filter([
157+
'authorization_code' => ! empty($this->redirect_uris),
158+
'client_credentials' => $this->confidential() && $this->firstParty(),
159+
'implicit' => ! empty($this->redirect_uris),
160+
'password' => $this->password_client,
161+
'personal_access' => $this->personal_access_client && $this->confidential(),
162+
'refresh_token' => true,
163+
'urn:ietf:params:oauth:grant-type:device_code' => true,
164+
])),
171165
);
172166
}
173167

0 commit comments

Comments
 (0)