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