Minifying HTML using Psr7Middleware::minify()

I’m trying to minify the HTML generated by my app using Psr7Middlewares\Middleware::minify() (the CSS and JS are already minified in my build environment).

So in my middleware.php I added the following:


However, my HTML remains as un-minified as it has been since day 1. Can someone tell me what I’m doing wrong?