Total Complexity | 6 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
15 | trait TAuthLock |
||
16 | { |
||
17 | use TLang; |
||
18 | |||
19 | protected ?ILock $lock = null; |
||
20 | |||
21 | 81 | protected function initAuthLock(?ILock $lock): void |
|
24 | 81 | } |
|
25 | |||
26 | /** |
||
27 | * @throws AuthSourcesException |
||
28 | * @return ILock |
||
29 | */ |
||
30 | 51 | protected function getLock(): ILock |
|
31 | { |
||
32 | 51 | if (!$this->lock) { |
|
33 | 1 | throw new AuthSourcesException($this->getAusLang()->kauLockSystemNotSet()); |
|
34 | } |
||
35 | 50 | return $this->lock; |
|
36 | } |
||
37 | |||
38 | /** |
||
39 | * @param string $note |
||
40 | * @throws AuthSourcesException |
||
41 | * @throws LockException |
||
42 | */ |
||
43 | 51 | protected function checkLock(string $note = ''): void |
|
47 | } |
||
48 | 28 | } |
|
50 |