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

ExtensionProcessingContext::addOutput()   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 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace MadWizard\WebAuthn\Extension;
4
5
final class ExtensionProcessingContext
6
{
7
    /**
8
     * @var string
9
     */
10
    private $operation;
11
12
    /**
13
     * @var string|null
14
     */
15
    private $overruledRpId;
16
17
    /**
18
     * @var array<string, ExtensionOutputInterface>
19
     */
20
    private $outputs = [];
21
22
    public function __construct(string $operation)
23
    {
24
        $this->operation = $operation;
25
    }
26
27
    public function getOperation(): string
28
    {
29
        return $this->operation;
30
    }
31
32
    public function getOverruledRpId(): ?string
33
    {
34
        return $this->overruledRpId;
35
    }
36
37
    public function setOverruledRpId(?string $overruledRpId): void
38
    {
39
        $this->overruledRpId = $overruledRpId;
40
    }
41
42
    public function addOutput(ExtensionOutputInterface $output)
43
    {
44
        $this->outputs[$output->getIdentifier()] = $output;
45
    }
46
47
//    public function getOutput(string $identifier)
48
//    {
49
//        $output = $this->outputs[$identifier] ?? null;
50
//
51
//    }
52
}
53