This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
13
{
14
use Utils\ResolverTrait;
15
16
/**
17
* Execute the middleware.
18
*
19
* @param ServerRequestInterface $request
20
* @param ResponseInterface $response
21
* @param callable $next
22
*
23
* @return ResponseInterface
24
*/
25
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next)
26
{
27
if (!Middleware::hasAttribute($request, FormatNegotiator::KEY)) {
28
throw new RuntimeException('Minify middleware needs FormatNegotiator executed before');
29
}
30
31
$resolver = $this->resolver ?: new Transformers\Minifier();
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.