1 | <?php declare(strict_types=1); |
||
34 | trait ApplicationWrapperTrait |
||
35 | { |
||
36 | /** |
||
37 | * @var array |
||
38 | */ |
||
39 | private $events = []; |
||
40 | |||
41 | /** |
||
42 | * @var PsrContainerInterface |
||
43 | */ |
||
44 | private $container; |
||
45 | |||
46 | /** |
||
47 | 1 | * @param Closure $handler |
|
48 | * |
||
49 | 1 | * @return ApplicationWrapperInterface |
|
50 | */ |
||
51 | public function addOnHandleRequest(Closure $handler): ApplicationWrapperInterface |
||
55 | |||
56 | /** |
||
57 | 1 | * @param Closure $handler |
|
58 | * |
||
59 | 1 | * @return ApplicationWrapperInterface |
|
60 | */ |
||
61 | public function addOnHandleResponse(Closure $handler): ApplicationWrapperInterface |
||
65 | |||
66 | /** |
||
67 | 1 | * @param Closure $handler |
|
68 | * |
||
69 | 1 | * @return ApplicationWrapperInterface |
|
70 | */ |
||
71 | public function addOnContainerCreated(Closure $handler): ApplicationWrapperInterface |
||
75 | |||
76 | /** |
||
77 | 1 | * @param Closure $handler |
|
78 | * |
||
79 | 1 | * @return ApplicationWrapperInterface |
|
80 | */ |
||
81 | public function addOnContainerLastConfigurator(Closure $handler): ApplicationWrapperInterface |
||
85 | |||
86 | /** |
||
87 | * @param int $eventId |
||
88 | 1 | * @param Closure $handler |
|
89 | * |
||
90 | 1 | * @return ApplicationWrapperInterface |
|
91 | 1 | */ |
|
92 | 1 | protected function addEventHandler(int $eventId, Closure $handler): ApplicationWrapperInterface |
|
109 | |||
110 | /** |
||
111 | * @param int $eventId |
||
112 | 1 | * @param array $arguments |
|
113 | * |
||
114 | 1 | * @return void |
|
115 | 1 | */ |
|
116 | 1 | protected function dispatchEvent($eventId, array $arguments): void |
|
123 | 1 | ||
124 | /** |
||
125 | * @return LimoncelloContainerInterface |
||
126 | 1 | */ |
|
127 | protected function createContainerInstance(): LimoncelloContainerInterface |
||
136 | |||
137 | /** |
||
138 | * @param LimoncelloContainerInterface $container |
||
139 | * @param array|null $globalConfigurators |
||
140 | 1 | * @param array|null $routeConfigurators |
|
141 | * |
||
142 | * @return void |
||
143 | */ |
||
144 | protected function configureContainer( |
||
154 | |||
155 | /** |
||
156 | * @param Closure $handler |
||
157 | 1 | * @param RequestInterface|null $request |
|
158 | * |
||
159 | 1 | * @return ResponseInterface |
|
160 | */ |
||
161 | protected function handleRequest(Closure $handler, RequestInterface $request = null): ResponseInterface |
||
172 | 1 | ||
173 | /** |
||
174 | 1 | * @return PsrContainerInterface |
|
175 | */ |
||
176 | protected function getContainer(): PsrContainerInterface |
||
180 | } |
||
181 |