{"record":{"id":"803864e4b8d4d41c","repo":"slimphp/Slim","slug":"the-slim-http-serverrequest-decorator-is-not-avail","errorCode":null,"errorMessage":"The Slim-Http ServerRequest decorator is not available.","messagePattern":"The Slim-Http ServerRequest decorator is not available\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"Slim/Factory/Psr17/SlimHttpServerRequestCreator.php","lineNumber":36,"sourceCode":"\nclass SlimHttpServerRequestCreator implements ServerRequestCreatorInterface\n{\n    protected ServerRequestCreatorInterface $serverRequestCreator;\n\n    protected static string $serverRequestDecoratorClass = 'Slim\\Http\\ServerRequest';\n\n    public function __construct(ServerRequestCreatorInterface $serverRequestCreator)\n    {\n        $this->serverRequestCreator = $serverRequestCreator;\n    }\n\n    /**\n     * {@inheritdoc}\n     */\n    public function createServerRequestFromGlobals(): ServerRequestInterface\n    {\n        if (!static::isServerRequestDecoratorAvailable()) {\n            throw new RuntimeException('The Slim-Http ServerRequest decorator is not available.');\n        }\n\n        $request = $this->serverRequestCreator->createServerRequestFromGlobals();\n\n        if (\n            !((\n                $decoratedServerRequest = new static::$serverRequestDecoratorClass($request)\n                ) instanceof ServerRequestInterface)\n        ) {\n            throw new RuntimeException(get_called_class() . ' could not instantiate a decorated server request.');\n        }\n\n        return $decoratedServerRequest;\n    }\n\n    public static function isServerRequestDecoratorAvailable(): bool\n    {\n        return class_exists(static::$serverRequestDecoratorClass);","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/slimphp/Slim/blob/80900fb39cafce3ae53b18a2c4f642a122f03095/Slim/Factory/Psr17/SlimHttpServerRequestCreator.php#L18-L54","documentation":"Error \"The Slim-Http ServerRequest decorator is not available.\" thrown in slimphp/Slim.","triggerScenarios":"Thrown at Slim/Factory/Psr17/SlimHttpServerRequestCreator.php:36 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"80900fb39cafce3ae53b18a2c4f642a122f03095","analyzedAt":"2026-08-21T01:41:09.580Z","schemaVersion":2},"datasetVersion":"2026-08-21T03:17:12.404Z"}