{"record":{"id":"18a39d51ce061e57","repo":"slimphp/Slim","slug":"invalid-style-style-must-be-append-or-pre","errorCode":null,"errorMessage":"Invalid style `{$style}`. Must be `append` or `prepend`","messagePattern":"Invalid style `(.+?)`\\. Must be `append` or `prepend`","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"Slim/Middleware/OutputBufferingMiddleware.php","lineNumber":45,"sourceCode":"class OutputBufferingMiddleware implements MiddlewareInterface\n{\n    public const APPEND = 'append';\n    public const PREPEND = 'prepend';\n\n    protected StreamFactoryInterface $streamFactory;\n\n    protected string $style;\n\n    /**\n     * @param string $style Either \"append\" or \"prepend\"\n     */\n    public function __construct(StreamFactoryInterface $streamFactory, string $style = 'append')\n    {\n        $this->streamFactory = $streamFactory;\n        $this->style = $style;\n\n        if (!in_array($style, [static::APPEND, static::PREPEND], true)) {\n            throw new InvalidArgumentException(\"Invalid style `{$style}`. Must be `append` or `prepend`\");\n        }\n    }\n\n    /**\n     * @throws Throwable\n     */\n    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface\n    {\n        try {\n            ob_start();\n            $response = $handler->handle($request);\n            $output = ob_get_clean();\n        } catch (Throwable $e) {\n            ob_end_clean();\n            throw $e;\n        }\n\n        if (!empty($output)) {","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/slimphp/Slim/blob/80900fb39cafce3ae53b18a2c4f642a122f03095/Slim/Middleware/OutputBufferingMiddleware.php#L27-L63","documentation":"Error \"Invalid style `{$style}`. Must be `append` or `prepend`\" thrown in slimphp/Slim.","triggerScenarios":"Thrown at Slim/Middleware/OutputBufferingMiddleware.php:45 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"}