Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
7 / 7 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
AccountLogoutLogic | |
100.00% |
7 / 7 |
|
100.00% |
3 / 3 |
4 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
validateImpl | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
executeImpl | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
2 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace PeServer\App\Models\Domain\Page\Account; |
6 | |
7 | use PeServer\App\Models\AuditLog; |
8 | use PeServer\Core\Mvc\LogicCallMode; |
9 | use PeServer\Core\Mvc\LogicParameter; |
10 | use PeServer\App\Models\SessionKey; |
11 | use PeServer\App\Models\Domain\Page\PageLogicBase; |
12 | |
13 | class AccountLogoutLogic extends PageLogicBase |
14 | { |
15 | public function __construct(LogicParameter $parameter) |
16 | { |
17 | parent::__construct($parameter); |
18 | } |
19 | |
20 | #region PageLogicBase |
21 | |
22 | protected function validateImpl(LogicCallMode $callMode): void |
23 | { |
24 | //NOP |
25 | } |
26 | |
27 | protected function executeImpl(LogicCallMode $callMode): void |
28 | { |
29 | $userInfo = $this->getSession(SessionKey::ACCOUNT, null); |
30 | if ($userInfo === null) { |
31 | return; |
32 | } |
33 | |
34 | $this->writeAuditLogCurrentUser(AuditLog::LOGOUT); |
35 | |
36 | $this->shutdownSession(); |
37 | } |
38 | |
39 | #endregion |
40 | } |