Passed
Pull Request — master (#34)
by Anatoly
02:04
created

OAuthFlow::setTokenUrl()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php declare(strict_types=1);
2
3
/**
4
 * It's free open-source software released under the MIT License.
5
 *
6
 * @author Anatoly Fenric <[email protected]>
7
 * @copyright Copyright (c) 2018, Anatoly Fenric
8
 * @license https://github.com/sunrise-php/http-router/blob/master/LICENSE
9
 * @link https://github.com/sunrise-php/http-router
10
 */
11
12
namespace Sunrise\Http\Router\OpenApi;
13
14
/**
15
 * OAS OAuth Flow Object
16
 *
17
 * @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#oauth-flow-object
18
 */
19
class OAuthFlow extends AbstractObject
20
{
21
22
    /**
23
     * @var string
24
     *
25
     * @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-oauthflowauthorizationurl
26
     */
27
    protected $authorizationUrl;
28
29
    /**
30
     * @var string
31
     *
32
     * @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-oauthflowtokenurl
33
     */
34
    protected $tokenUrl;
35
36
    /**
37
     * @var string
38
     *
39
     * @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-oauthflowrefreshurl
40
     */
41
    protected $refreshUrl;
42
43
    /**
44
     * @var string[]
45
     *
46
     * @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-oauthflowscopes
47
     */
48
    protected $scopes;
49
50
    /**
51
     * @param string $authorizationUrl
52
     *
53
     * @return void
54
     */
55 1
    public function setAuthorizationUrl(string $authorizationUrl) : void
56
    {
57 1
        $this->authorizationUrl = $authorizationUrl;
58 1
    }
59
60
    /**
61
     * @param string $tokenUrl
62
     *
63
     * @return void
64
     */
65 1
    public function setTokenUrl(string $tokenUrl) : void
66
    {
67 1
        $this->tokenUrl = $tokenUrl;
68 1
    }
69
70
    /**
71
     * @param string $refreshUrl
72
     *
73
     * @return void
74
     */
75 1
    public function setRefreshUrl(string $refreshUrl) : void
76
    {
77 1
        $this->refreshUrl = $refreshUrl;
78 1
    }
79
80
    /**
81
     * @param string $name
82
     * @param string $description
83
     *
84
     * @return void
85
     */
86 1
    public function addScope(string $name, string $description) : void
87
    {
88 1
        $this->scopes[$name] = $description;
89 1
    }
90
}
91