Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
4 / 4 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
AbstractMiddleware | |
100.00% |
4 / 4 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
getRouters | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getPostProcessors | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | namespace Miniframe\Core; |
4 | |
5 | abstract class AbstractMiddleware |
6 | { |
7 | /** |
8 | * Reference to the Request object |
9 | * |
10 | * @var Request |
11 | */ |
12 | protected $request; |
13 | /** |
14 | * Reference to the Config object |
15 | * |
16 | * @var Config |
17 | */ |
18 | protected $config; |
19 | |
20 | /** |
21 | * Initializes a Middleware package |
22 | * |
23 | * @param Request $request Reference to the Request object. |
24 | * @param Config $config Reference to the Config object. |
25 | */ |
26 | public function __construct(Request $request, Config $config) |
27 | { |
28 | $this->request = $request; |
29 | $this->config = $config; |
30 | } |
31 | |
32 | /** |
33 | * Returns a list of callables that can convert a Config + Request object to a Controller callable. |
34 | * |
35 | * For a good example, see ../Middleware/UrlToMvcRouter.php |
36 | * |
37 | * @return callable[] |
38 | */ |
39 | public function getRouters(): array |
40 | { |
41 | return []; |
42 | } |
43 | |
44 | /** |
45 | * Returns a list of Post Processors that can modify the response after rendering |
46 | * |
47 | * @return callable[] |
48 | */ |
49 | public function getPostProcessors(): array |
50 | { |
51 | return []; |
52 | } |
53 | } |