AuthorizationCode::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace tbclla\Revolut\Auth;
4
5
use tbclla\Revolut\Interfaces\GrantsAccessTokens;
6
7
class AuthorizationCode implements GrantsAccessTokens
8
{
9
    /**
10
     * The token value
11
     * 
12
     * @var string
13
     */
14
    public $value;
15
16
    /**
17
     * Create a new authorization code instance
18
     * 
19
     * @param string $value The authorization code supplied by Revolut
20
     */
21
    public function __construct(string $value)
22
    {
23
        $this->value = $value;
24
    }
25
26
    public function getValue()
27
    {
28
        return $this->value;
29
    }
30
31
    public static function getType()
32
    {
33
        return 'code';
34
    }
35
36
    public static function getGrantType()
37
    {
38
        return 'authorization_code';
39
    }
40
}
41