Test Failed
Push — master ( 9eb68a...5271f3 )
by Thomas
02:48
created

AbstractExtension::getSupportedOperations()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace MadWizard\WebAuthn\Extension;
4
5
use MadWizard\WebAuthn\Exception\WebAuthnException;
6
7
abstract class AbstractExtension implements ExtensionInterface
8
{
9
    /**
10
     * @var string
11
     */
12
    private $identifier;
13
14
    /**
15
     * @var string[]
16
     */
17
    private $supportedOperations;
18
19
    public function __construct(string $identifier, array $supportedOperations)
20
    {
21
        $this->identifier = $identifier;
22
23
        if (!ExtensionHelper::validExtensionIdentifier($identifier)) {
24
            throw new WebAuthnException(sprintf("Invalid extension identifier '%s'.", $identifier));
25
        }
26
        $this->supportedOperations = $supportedOperations;
27
    }
28
29
    public function getIdentifier(): string
30
    {
31
        return $this->identifier;
32
    }
33
34
    public function getSupportedOperations(): array
35
    {
36
        return $this->supportedOperations;
37
    }
38
}
39