Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
AdministratorApiDeleteOldDataLogic
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 3
12
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 validateImpl
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 executeImpl
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3declare(strict_types=1);
4
5namespace PeServer\App\Models\Domain\Api\AdministratorApi;
6
7use PeServer\App\Models\AuditLog;
8use PeServer\App\Models\Domain\Api\ApiLogicBase;
9use PeServer\App\Models\Domain\AppArchiver;
10use PeServer\App\Models\Domain\AppEraser;
11use PeServer\App\Models\ResponseJson;
12use PeServer\Core\Mvc\LogicCallMode;
13use PeServer\Core\Mvc\LogicParameter;
14
15class AdministratorApiDeleteOldDataLogic extends ApiLogicBase
16{
17    public function __construct(LogicParameter $parameter, private AppEraser $appEraser)
18    {
19        parent::__construct($parameter);
20    }
21
22    #region ApiLogicBase
23
24    protected function validateImpl(LogicCallMode $callMode): void
25    {
26        //NOP
27    }
28
29    protected function executeImpl(LogicCallMode $callMode): void
30    {
31        // セッション動かしてないので無理
32        // // セッション掃除。
33        // $sessionGcResult = session_gc();
34        // $this->logger->info("session_gc: {0}", $sessionGcResult);
35
36        // アプリデータ削除
37        $this->appEraser->execute();
38
39        $this->writeAuditLogCurrentUser(AuditLog::API_ADMINISTRATOR_DELETE_OLD_DATA);
40
41        $this->setResponseJson(ResponseJson::success([]));
42    }
43
44    #endregion
45}