| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | 11 | public function getForAccessToken(AccessTokenEntityInterface $accessToken, CryptKey $privateKey) |
|
| 22 | { |
||
| 23 | 11 | $now = Carbon::now(); |
|
| 24 | |||
| 25 | 11 | return (new Builder) |
|
| 26 | 11 | ->setIssuer(url('/')) |
|
|
|
|||
| 27 | 11 | ->setIssuedAt($now->timestamp) |
|
| 28 | 11 | ->setNotBefore($now->timestamp) |
|
| 29 | 11 | ->setId($accessToken->getIdentifier()) |
|
| 30 | 11 | ->setExpiration($accessToken->getExpiryDateTime()->getTimestamp()) |
|
| 31 | 11 | ->setAudience($accessToken->getClient()->getIdentifier()) |
|
| 32 | 11 | ->setSubject($accessToken->getUserIdentifier()) |
|
| 33 | 11 | ->set('scopes', implode(',', $this->getScopesAsList($accessToken))) |
|
| 34 | 11 | ->sign(new Sha256, new Key($privateKey->getKeyPath(), $privateKey->getPassPhrase())) |
|
| 35 | 11 | ->getToken(); |
|
| 36 | } |
||
| 37 | |||
| 54 |
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.