AbstractTLS   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 16
ccs 6
cts 6
cp 1
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A createRequest() 0 14 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace TMV\OpenIdClient\AuthMethod;
6
7
use function array_merge;
8
use function http_build_query;
9
use Psr\Http\Message\RequestInterface;
10
use TMV\OpenIdClient\Client\ClientInterface as OpenIDClient;
11
12
abstract class AbstractTLS implements AuthMethodInterface
13
{
14 2
    public function createRequest(
15
        RequestInterface $request,
16
        OpenIDClient $client,
17
        array $claims
18
    ): RequestInterface {
19 2
        $clientId = $client->getMetadata()->getClientId();
20
21 2
        $claims = array_merge($claims, [
22 2
            'client_id' => $clientId,
23
        ]);
24
25 2
        $request->getBody()->write(http_build_query($claims));
26
27 2
        return $request;
28
    }
29
}
30