Completed
Push — master ( cec1cf...f9a404 )
by Javi
03:27
created

OauthFlow::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 4
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
ccs 5
cts 5
cp 1
crap 1
1
<?php
2
3
namespace erasys\OpenApi\Spec\v3;
4
5
/**
6
 * Configuration details for a supported OAuth Flow
7
 *
8
 * @see https://swagger.io/specification/#oauthFlowObject
9
 */
10
class OauthFlow extends AbstractObject implements ExtensibleInterface
11
{
12
    /**
13
     * REQUIRED. The authorization URL to be used for this flow. This MUST be in the form of a URL.
14
     *
15
     * Applies To: oauth2 ("implicit", "authorizationCode")
16
     *
17
     * @var string
18
     */
19
    public $authorizationUrl;
20
21
    /**
22
     * REQUIRED. The token URL to be used for this flow. This MUST be in the form of a URL.
23
     *
24
     * Applies To: oauth2 ("password", "clientCredentials", "authorizationCode")
25
     *
26
     * @var string
27
     */
28
    public $tokenUrl;
29
30
    /**
31
     * REQUIRED. The available scopes for the OAuth2 security scheme. A map between the scope name and a short
32
     * description for it.
33
     *
34
     * Applies To: oauth2
35
     *
36
     * @var string[] array<string,string>
37
     */
38
    public $scopes;
39
40
    /**
41
     * The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL.
42
     *
43
     * Applies To: oauth2
44
     *
45
     * @var string
46
     */
47
    public $refreshUrl;
48
49
    /**
50
     * @param string   $authorizationUrl
51
     * @param string   $tokenUrl
52
     * @param string[] $scopes
53
     * @param array    $additionalProperties
54
     */
55 3
    public function __construct(
56
        string $authorizationUrl,
57
        string $tokenUrl,
58
        array $scopes,
59
        array $additionalProperties = []
60
    ) {
61 3
        parent::__construct($additionalProperties);
62 3
        $this->authorizationUrl = $authorizationUrl;
63 3
        $this->tokenUrl         = $tokenUrl;
64 3
        $this->scopes           = $scopes;
65 3
    }
66
}
67