StaticProvider::getAuthorization()   A
last analyzed

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
dl 0
loc 4
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Facile\OAuth2\HttpClient\Authorization;
6
7
use Facile\OAuth2\HttpClient\Request\OAuth2RequestInterface;
8
use Facile\OpenIDClient\Client\ClientInterface;
9
10
class StaticProvider implements AuthorizationProvider
11
{
12
    /** @var string */
13
    private $authorization;
14
15 1
    public function __construct(string $authorization)
16
    {
17 1
        $this->authorization = $authorization;
18 1
    }
19
20 1
    public function getAuthorization(ClientInterface $client, OAuth2RequestInterface $request): ?string
21
    {
22 1
        return $this->authorization;
23
    }
24
25
    public function saveAuthorization(
26
        ClientInterface $client,
27
        OAuth2RequestInterface $request,
28
        string $authorization,
29
        ?int $ttl = null
30
    ): void {
31
    }
32
}
33