normalizeRequiredSchemeProperties()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Aweapi\Openapi\Objects\SecurityScheme;
6
7
use Aweapi\Openapi\Extensions;
8
use Aweapi\Openapi\Objects\OAuthFlows;
9
use Aweapi\Openapi\Objects\SecurityScheme;
10
11
final class OAuth2SecurityScheme extends SecurityScheme
12
{
13
    private $flows;
14
15 2
    public function __construct(
16
        OAuthFlows $flows,
17
        string $description = null,
18
        Extensions $extensions = null
19
    ) {
20 2
        parent::__construct(
21 2
            SecurityScheme::TYPE_OAUTH2,
22
            $description,
23
            $extensions
24
        );
25 2
        $this->flows = $flows;
26
    }
27
28 2
    public function getFlows(): OAuthFlows
29
    {
30 2
        return $this->flows;
31
    }
32
33 2
    protected function normalizeRequiredSchemeProperties(): array
34
    {
35
        return [
36 2
            'flows' => $this->getFlows()->jsonSerialize(),
37
        ];
38
    }
39
}
40