Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
AuthCodeEntity | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
jsonSerialize | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Extension\OAuth\Entity; |
4 | |
5 | use JsonSerializable; |
6 | use League\OAuth2\Server\Entities\AuthCodeEntityInterface; |
7 | use League\OAuth2\Server\Entities\Traits\AuthCodeTrait; |
8 | use League\OAuth2\Server\Entities\Traits\EntityTrait; |
9 | use League\OAuth2\Server\Entities\Traits\TokenEntityTrait; |
10 | |
11 | class AuthCodeEntity implements AuthCodeEntityInterface, JsonSerializable { |
12 | use TokenEntityTrait; |
13 | use EntityTrait; |
14 | use AuthCodeTrait; |
15 | |
16 | public function jsonSerialize(): array { |
17 | return [ |
18 | 'user' => $this->getUserIdentifier(), |
19 | 'client' => $this->getClient()->getIdentifier(), |
20 | 'identifier' => $this->getIdentifier(), |
21 | 'redirectUri' => $this->getRedirectUri(), |
22 | 'scopes' => $this->getScopes(), |
23 | 'expires' => $this->getExpiryDateTime()->getTimestamp() |
24 | ]; |
25 | } |
26 | } |