| @@ 23-29 (lines=7) @@ | ||
| 20 | * |
|
| 21 | * @return ResponseInterface |
|
| 22 | */ |
|
| 23 | public function js(ResponseInterface $response) |
|
| 24 | { |
|
| 25 | $stream = Middleware::createStream(); |
|
| 26 | $stream->write(JSMinPlus::minify((string) $response->getBody())); |
|
| 27 | ||
| 28 | return $response->withBody($stream); |
|
| 29 | } |
|
| 30 | ||
| 31 | /** |
|
| 32 | * CSS minifier. |
|
| @@ 53-59 (lines=7) @@ | ||
| 50 | * |
|
| 51 | * @return ResponseInterface |
|
| 52 | */ |
|
| 53 | public function html(ResponseInterface $response) |
|
| 54 | { |
|
| 55 | $stream = Middleware::createStream(); |
|
| 56 | $stream->write(Minify_HTML::minify((string) $response->getBody(), ['jsCleanComments' => true])); |
|
| 57 | ||
| 58 | return $response->withBody($stream); |
|
| 59 | } |
|
| 60 | } |
|
| 61 | ||