AbstractResponseType   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 23
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setPrivateKey() 0 3 1
A setRefreshToken() 0 3 1
A setAccessToken() 0 3 1
1
<?php
2
3
/**
4
 * OAuth 2.0 Abstract Response Type.
5
 *
6
 * @author      Alex Bilbie <[email protected]>
7
 * @copyright   Copyright (c) Alex Bilbie
8
 * @license     http://mit-license.org/
9
 *
10
 * @link        https://github.com/thephpleague/oauth2-server
11
 */
12
13
declare(strict_types=1);
14
15
namespace League\OAuth2\Server\ResponseTypes;
16
17
use League\OAuth2\Server\CryptKeyInterface;
18
use League\OAuth2\Server\CryptTrait;
19
use League\OAuth2\Server\Entities\AccessTokenEntityInterface;
20
use League\OAuth2\Server\Entities\RefreshTokenEntityInterface;
21
22
abstract class AbstractResponseType implements ResponseTypeInterface
23
{
24
    use CryptTrait;
25
26
    protected AccessTokenEntityInterface $accessToken;
27
28
    protected RefreshTokenEntityInterface $refreshToken;
29
30
    protected CryptKeyInterface $privateKey;
31
32 5
    public function setAccessToken(AccessTokenEntityInterface $accessToken): void
33
    {
34 5
        $this->accessToken = $accessToken;
35
    }
36
37 5
    public function setRefreshToken(RefreshTokenEntityInterface $refreshToken): void
38
    {
39 5
        $this->refreshToken = $refreshToken;
40
    }
41
42 14
    public function setPrivateKey(CryptKeyInterface $key): void
43
    {
44 14
        $this->privateKey = $key;
45
    }
46
}
47