From df8b825152a5090570a102d20b5dd33e8c48ab1c Mon Sep 17 00:00:00 2001 From: Rougin Gutib Date: Sun, 26 Nov 2023 00:44:14 +0800 Subject: [PATCH] Do not execute MiddlewareIntegration if the interface not found --- src/Middleware/MiddlewareIntegration.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Middleware/MiddlewareIntegration.php b/src/Middleware/MiddlewareIntegration.php index 66560c75..0fbc8228 100644 --- a/src/Middleware/MiddlewareIntegration.php +++ b/src/Middleware/MiddlewareIntegration.php @@ -27,6 +27,11 @@ class MiddlewareIntegration implements IntegrationInterface */ public function define(ContainerInterface $container, Configuration $config) { + if (! interface_exists('Interop\Http\ServerMiddleware\MiddlewareInterface')) + { + return $container; + } + /** @var \Psr\Http\Message\ResponseInterface */ $response = $container->get('Psr\Http\Message\ResponseInterface');