Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
40.00% |
4 / 10 |
|
50.00% |
2 / 4 |
CRAP | |
0.00% |
0 / 1 |
PluginApiController | |
40.00% |
4 / 10 |
|
50.00% |
2 / 4 |
7.46 | |
0.00% |
0 / 1 |
__construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
exists | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
generate_plugin_id | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
information | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace PeServer\App\Controllers\Api; |
6 | |
7 | use PeServer\Core\Http\HttpRequest; |
8 | use PeServer\Core\Mvc\Result\IActionResult; |
9 | use PeServer\Core\Mvc\LogicCallMode; |
10 | use PeServer\Core\Mvc\ControllerArgument; |
11 | use PeServer\App\Controllers\Api\ApiControllerBase; |
12 | use PeServer\App\Models\Domain\Api\PluginApi\PluginApiExistsLogic; |
13 | use PeServer\App\Models\Domain\Api\PluginApi\PluginApiInformationLogic; |
14 | use PeServer\App\Models\Domain\Api\PluginApi\PluginApiGeneratePluginIdLogic; |
15 | |
16 | /** |
17 | * [API] Pe/プラグインから呼び出されるコントローラ。 |
18 | * |
19 | * 管理やら開発都合でなくユーザー用に外向いているのはこいつ(2)。 |
20 | */ |
21 | class PluginApiController extends ApiControllerBase |
22 | { |
23 | public function __construct(ControllerArgument $argument) |
24 | { |
25 | parent::__construct($argument); |
26 | } |
27 | |
28 | public function exists(): IActionResult |
29 | { |
30 | $logic = $this->createLogic(PluginApiExistsLogic::class); |
31 | $logic->run(LogicCallMode::Submit); |
32 | |
33 | return $this->data($logic->getContent()); |
34 | } |
35 | |
36 | public function generate_plugin_id(): IActionResult |
37 | { |
38 | $logic = $this->createLogic(PluginApiGeneratePluginIdLogic::class); |
39 | $logic->run(LogicCallMode::Submit); |
40 | |
41 | return $this->data($logic->getContent()); |
42 | } |
43 | |
44 | public function information(): IActionResult |
45 | { |
46 | $logic = $this->createLogic(PluginApiInformationLogic::class); |
47 | $logic->run(LogicCallMode::Submit); |
48 | |
49 | return $this->data($logic->getContent()); |
50 | } |
51 | } |