AbstractTLS::createRequest()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 14
ccs 6
cts 6
cp 1
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 3
crap 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