Due to PHP Bug #53727, is_subclass_of might return inconsistent results on some PHP versions if \Psr\Http\Server\MiddlewareInterface::class can be an interface. If so, you could instead use ReflectionClass::implementsInterface.
Loading history...
33
return new $middleware;
34
}
35
if (is_callable($middleware)) {
36
return new CallableMiddlewareDecorator($middleware);
37
}
38
throw new \InvalidArgumentException('Invalid middleware format');