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

None::getSupportedMethod()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
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