Conditions | 1 |
Paths | 1 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
26 | protected function buildResponse(): PluginInterface |
||
27 | { |
||
28 | return new class() implements PluginInterface { |
||
29 | public function assembly(Rocket $rocket, Closure $next): Rocket |
||
30 | { |
||
31 | $rocket->setDestination(new Response()); |
||
32 | |||
33 | /* @var Rocket $rocket */ |
||
34 | $rocket = $next($rocket); |
||
35 | |||
36 | $response = $this->buildHtml($rocket->getPayload()); |
||
37 | |||
38 | return $rocket->setDestination($response); |
||
39 | } |
||
40 | |||
41 | protected function buildHtml(Collection $payload): Response |
||
42 | { |
||
43 | return new Response(200, [], Arr::query($payload->all())); |
||
44 | } |
||
45 | }; |
||
46 | } |
||
47 | } |
||
48 |