Completed
Push — master ( 648369...25aaae )
by Thomas Mauro
01:45
created

None::createRequest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 3
dl 0
loc 10
ccs 0
cts 4
cp 0
crap 2
rs 9.9332
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Facile\OpenIDClient\AuthMethod;
6
7
use function array_merge;
8
use Facile\OpenIDClient\Client\ClientInterface as OpenIDClient;
9
use function http_build_query;
10
use Psr\Http\Message\RequestInterface;
11
12
final class None implements AuthMethodInterface
13
{
14 2
    public function getSupportedMethod(): string
15
    {
16 2
        return 'none';
17
    }
18
19
    public function createRequest(
20
        RequestInterface $request,
21
        OpenIDClient $client,
22
        array $claims
23
    ): RequestInterface {
24
        $params = array_merge(['client_id' => $client->getMetadata()->getClientId()], $claims);
25
        $request->getBody()->write(http_build_query($params));
26
27
        return $request;
28
    }
29
}
30