Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
ActionSetting
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 none
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace PeServer\Core\Mvc;
6
7use PeServer\Core\Mvc\Middleware\IMiddleware;
8use PeServer\Core\Mvc\Middleware\IShutdownMiddleware;
9use PeServer\Core\Text;
10
11/**
12 * HTTPメソッドとコントローラメソッドの紐づけ。
13 */
14readonly class ActionSetting
15{
16    /**
17     * 生成。
18     *
19     * @param string $controllerMethod コントローラの呼び出しメソッド名。
20     * @param array<IMiddleware|class-string<IMiddleware>> $actionMiddleware アクションミドルウェア。
21     * @param array<IShutdownMiddleware|class-string<IShutdownMiddleware>> $shutdownMiddleware シャットダウンミドルウェア。
22     */
23    public function __construct(
24        public string $controllerMethod,
25        public array $actionMiddleware,
26        public array $shutdownMiddleware
27    ) {
28    }
29
30    #region function
31
32    public static function none(): ActionSetting
33    {
34        return new ActionSetting(Text::EMPTY, [], []);
35    }
36
37    #endregion
38}