Total Complexity | 10 |
Total Lines | 83 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | final class AuthContext implements AuthContextInterface |
||
15 | { |
||
16 | /** @var ActorProviderInterface */ |
||
17 | private $actorProvider; |
||
18 | |||
19 | /** @var TokenInterface|null */ |
||
20 | private $token; |
||
21 | |||
22 | /** @var object|null */ |
||
23 | private $actor; |
||
24 | |||
25 | /** @var string|null */ |
||
26 | private $transport; |
||
27 | |||
28 | /** @var bool */ |
||
29 | private $closed = false; |
||
30 | |||
31 | /** |
||
32 | * @param ActorProviderInterface $actorProvider |
||
33 | */ |
||
34 | public function __construct(ActorProviderInterface $actorProvider) |
||
35 | { |
||
36 | $this->actorProvider = $actorProvider; |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * @inheritDoc |
||
41 | */ |
||
42 | public function start(TokenInterface $token, string $transport = null): void |
||
43 | { |
||
44 | $this->closed = false; |
||
45 | $this->actor = null; |
||
46 | $this->token = $token; |
||
47 | $this->transport = $transport; |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * @inheritDoc |
||
52 | */ |
||
53 | public function getToken(): ?TokenInterface |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * @inheritDoc |
||
60 | */ |
||
61 | public function getTransport(): ?string |
||
62 | { |
||
63 | return $this->transport; |
||
64 | } |
||
65 | |||
66 | /** |
||
67 | * @inheritDoc |
||
68 | */ |
||
69 | public function getActor(): ?object |
||
80 | } |
||
81 | |||
82 | /** |
||
83 | * @inheritDoc |
||
84 | */ |
||
85 | public function close(): void |
||
86 | { |
||
87 | $this->closed = true; |
||
88 | $this->actor = null; |
||
89 | } |
||
90 | |||
91 | /** |
||
92 | * @inheritDoc |
||
93 | */ |
||
94 | public function isClosed(): bool |
||
97 | } |
||
98 | } |
||
99 |