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

None   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 33.33%

Importance

Changes 0
Metric Value
dl 0
loc 18
ccs 2
cts 6
cp 0.3333
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getSupportedMethod() 0 4 1
A createRequest() 0 10 1
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