Skip to content

Commit

Permalink
Do not execute MiddlewareIntegration if the interface not found
Browse files Browse the repository at this point in the history
  • Loading branch information
rougin committed Nov 25, 2023
1 parent 1d74611 commit df8b825
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Middleware/MiddlewareIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down

0 comments on commit df8b825

Please sign in to comment.