diff --git a/src/Middleware/MiddlewareIntegration.php b/src/Middleware/MiddlewareIntegration.php index 90106d28..6bfd3165 100644 --- a/src/Middleware/MiddlewareIntegration.php +++ b/src/Middleware/MiddlewareIntegration.php @@ -72,10 +72,13 @@ protected function dispatcher(ResponseInterface $response, $stack) $wantZend = $this->preferred === 'stratigility'; - if (($empty || (! $wantZend)) || ! $hasZend) return $dispatcher; + if (($empty || $wantZend) && $hasZend) + { + $pipe = new MiddlewarePipe; - $pipe = new MiddlewarePipe; + $dispatcher = new StratigilityDispatcher($pipe, $stack, $response); + } - return new StratigilityDispatcher($pipe, $stack, $response); + return $dispatcher; } } \ No newline at end of file