ApiKeySecurityScheme::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 14
ccs 5
cts 5
cp 1
rs 9.7998
c 0
b 0
f 0
cc 1
nc 1
nop 4
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\SecurityScheme;
9
10
final class ApiKeySecurityScheme extends SecurityScheme
11
{
12
    private $in;
13
14
    private $name;
15
16 4
    public function __construct(
17
        string $name,
18
        string $in,
19
        string $description = null,
20
        Extensions $extensions = null
21
    ) {
22 4
        parent::__construct(
23 4
            SecurityScheme::TYPE_API_KEY,
24
            $description,
25
            $extensions
26
        );
27 4
        $this->name = $name;
28 4
        $this->in = $in;
29
    }
30
31 3
    public function getIn(): string
32
    {
33 3
        return $this->in;
34
    }
35
36 3
    public function getName(): string
37
    {
38 3
        return $this->name;
39
    }
40
41 3
    protected function normalizeRequiredSchemeProperties(): array
42
    {
43
        return [
44 3
            'name' => $this->getName(),
45 3
            'in' => $this->getIn(),
46
        ];
47
    }
48
}
49