Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
95.00% covered (success)
95.00%
19 / 20
87.50% covered (warning)
87.50%
7 / 8
CRAP
0.00% covered (danger)
0.00%
0 / 1
HomeController
95.00% covered (success)
95.00%
19 / 20
87.50% covered (warning)
87.50%
7 / 8
8
0.00% covered (danger)
0.00%
0 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 index
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
 privacy
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
 contact_get
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
 about
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
 api
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
 wildcard
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
 exception
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3declare(strict_types=1);
4
5namespace PeServer\App\Controllers\Page;
6
7use Exception;
8use PeServer\App\Controllers\Page\PageControllerBase;
9use PeServer\App\Models\Domain\Page\Home\HomeAboutLogic;
10use PeServer\App\Models\Domain\Page\Home\HomeApiDocumentLogic;
11use PeServer\App\Models\Domain\Page\Home\HomeContactLogic;
12use PeServer\App\Models\Domain\Page\Home\HomeIndexLogic;
13use PeServer\App\Models\Domain\Page\Home\HomePrivacyLogic;
14use PeServer\App\Models\Domain\Page\Home\HomeWildcardLogic;
15use PeServer\Core\Http\HttpRequest;
16use PeServer\Core\Mvc\ControllerArgument;
17use PeServer\Core\Mvc\LogicCallMode;
18use PeServer\Core\Mvc\Result\IActionResult;
19
20/**
21 * [PAGE] ホームコントローラ。
22 */
23final class HomeController extends PageControllerBase
24{
25    public function __construct(ControllerArgument $argument)
26    {
27        parent::__construct($argument);
28    }
29
30    public function index(): IActionResult
31    {
32        $logic = $this->createLogic(HomeIndexLogic::class);
33        $logic->run(LogicCallMode::Initialize);
34
35        return $this->view('index', $logic->getViewData());
36    }
37
38    public function privacy(): IActionResult
39    {
40        $logic = $this->createLogic(HomePrivacyLogic::class);
41        $logic->run(LogicCallMode::Initialize);
42
43        return $this->view('privacy', $logic->getViewData());
44    }
45
46    public function contact_get(): IActionResult
47    {
48        $logic = $this->createLogic(HomeContactLogic::class);
49        $logic->run(LogicCallMode::Initialize);
50
51        return $this->view('contact', $logic->getViewData());
52    }
53
54    public function about(): IActionResult
55    {
56        $logic = $this->createLogic(HomeAboutLogic::class);
57        $logic->run(LogicCallMode::Initialize);
58
59        return $this->view('about', $logic->getViewData());
60    }
61
62    public function api(): IActionResult
63    {
64        $logic = $this->createLogic(HomeApiDocumentLogic::class);
65        $logic->run(LogicCallMode::Initialize);
66
67        return $this->view('api', $logic->getViewData());
68    }
69
70    public function wildcard(): IActionResult
71    {
72        $logic = $this->createLogic(HomeWildcardLogic::class);
73        $logic->run(LogicCallMode::Initialize);
74
75        return $this->data($logic->getContent());
76    }
77
78    public function exception(): IActionResult
79    {
80        throw new Exception();
81    }
82}