| Conditions | 2 |
| Paths | 2 |
| Total Lines | 21 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | 2 | public function createRequest( |
|
| 21 | RequestInterface $request, |
||
| 22 | OpenIDClient $client, |
||
| 23 | array $claims |
||
| 24 | ): RequestInterface { |
||
| 25 | 2 | $clientSecret = $client->getMetadata()->getClientSecret(); |
|
| 26 | |||
| 27 | 2 | if (null === $clientSecret) { |
|
| 28 | 1 | throw new InvalidArgumentException($this->getSupportedMethod() . ' cannot be used without client_secret metadata'); |
|
| 29 | } |
||
| 30 | |||
| 31 | 1 | $clientId = $client->getMetadata()->getClientId(); |
|
| 32 | |||
| 33 | 1 | $claims = array_merge($claims, [ |
|
| 34 | 1 | 'client_id' => $clientId, |
|
| 35 | 1 | 'client_secret' => $clientSecret, |
|
| 36 | ]); |
||
| 37 | |||
| 38 | 1 | $request->getBody()->write(http_build_query($claims)); |
|
| 39 | |||
| 40 | 1 | return $request; |
|
| 41 | } |
||
| 43 |