Passed
Push — master ( a019b6...0010e9 )
by Thomas
08:57
created

AbstractExtension::getSupportedOperations()   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 1
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 1
b 0
f 1
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 5
    public function __construct(string $identifier)
15
    {
16 5
        $this->identifier = $identifier;
17
18 5
        if (!ExtensionHelper::validExtensionIdentifier($identifier)) {
19
            throw new WebAuthnException(sprintf("Invalid extension identifier '%s'.", $identifier));
20
        }
21 5
    }
22
23
    public function getIdentifier(): string
24
    {
25
        return $this->identifier;
26
    }
27
}
28