Total Complexity | 4 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | trait CancellableTrait |
||
11 | { |
||
12 | protected ?string $cancelled = null; |
||
13 | |||
14 | /** |
||
15 | * Cancel login. |
||
16 | */ |
||
17 | 1 | public function cancel(string $reason): void |
|
18 | { |
||
19 | 1 | $this->cancelled = $reason; |
|
20 | } |
||
21 | |||
22 | /** |
||
23 | * Is login cancelled? |
||
24 | */ |
||
25 | 1 | public function isCancelled(): bool |
|
28 | } |
||
29 | |||
30 | /** |
||
31 | * Get reason why login was cancelled. |
||
32 | */ |
||
33 | 1 | public function getCancellationReason(): string |
|
34 | { |
||
35 | 1 | return (string)$this->cancelled; |
|
36 | } |
||
37 | |||
38 | /** |
||
39 | * @inheritDoc |
||
40 | */ |
||
41 | 1 | final public function isPropagationStopped(): bool |
|
44 | } |
||
45 | } |
||
46 |