| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Facile\OpenIDClient\AuthMethod; |
| 6 | |
| 7 | use Facile\OpenIDClient\Client\ClientInterface as OpenIDClient; |
| 8 | use Psr\Http\Message\RequestInterface; |
| 9 | use Override; |
| 10 | |
| 11 | use function array_merge; |
| 12 | use function http_build_query; |
| 13 | |
| 14 | final class None implements AuthMethodInterface |
| 15 | { |
| 16 | #[Override] |
| 17 | public function getSupportedMethod(): string |
| 18 | { |
| 19 | return 'none'; |
| 20 | } |
| 21 | |
| 22 | #[Override] |
| 23 | public function createRequest( |
| 24 | RequestInterface $request, |
| 25 | OpenIDClient $client, |
| 26 | array $claims |
| 27 | ): RequestInterface { |
| 28 | $params = array_merge(['client_id' => $client->getMetadata()->getClientId()], $claims); |
| 29 | $request->getBody()->write(http_build_query($params)); |
| 30 | |
| 31 | return $request; |
| 32 | } |
| 33 | } |