| Conditions | 3 |
| Paths | 4 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next) |
||
| 26 | { |
||
| 27 | $response = $next($request, $response); |
||
| 28 | |||
| 29 | $resolver = $this->resolver ?: new Transformers\Minifier(); |
||
| 30 | $transformer = $resolver->resolve(Utils\Helpers::getMimeType($response)); |
||
| 31 | |||
| 32 | if ($transformer) { |
||
| 33 | return $response->withBody($transformer($response->getBody(), self::createStream())); |
||
| 34 | } |
||
| 35 | |||
| 36 | return $response; |
||
| 37 | } |
||
| 38 | } |
||
| 39 |