StaticProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 71.43%

Importance

Changes 0
Metric Value
dl 0
loc 23
c 0
b 0
f 0
wmc 3
lcom 1
cbo 0
ccs 5
cts 7
cp 0.7143
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getAuthorization() 0 4 1
A saveAuthorization() 0 7 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