{"record":{"id":"7d9ea8e7dec913d7","repo":"Intervention/image","slug":"the-stroke-width-must-be-in-the-range-from-0-to-10","errorCode":null,"errorMessage":"The stroke width must be in the range from 0 to 10","messagePattern":"The stroke width must be in the range from 0 to 10","errorType":"exception","errorClass":"Intervention\\Image\\Exceptions\\InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/Typography/Font.php","lineNumber":177,"sourceCode":"     *\n     * @see FontInterface::strokeColor()\n     */\n    public function strokeColor(): null|string|ColorInterface\n    {\n        return $this->strokeColor;\n    }\n\n    /**\n     * {@inheritdoc}\n     *\n     * @see FontInterface::setStrokeWidth()\n     *\n     * @throws InvalidArgumentException\n     */\n    public function setStrokeWidth(int $width): FontInterface\n    {\n        if (!in_array($width, range(0, 10))) {\n            throw new InvalidArgumentException(\n                'The stroke width must be in the range from 0 to 10',\n            );\n        }\n\n        $this->strokeWidth = $width;\n\n        return $this;\n    }\n\n    /**\n     * {@inheritdoc}\n     *\n     * @see FontInterface::strokeWidth()\n     */\n    public function strokeWidth(): int\n    {\n        return $this->strokeWidth;\n    }","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/Intervention/image/blob/5598b9e39751c34afc5cdee84abef77f92c26f68/src/Typography/Font.php#L159-L195","documentation":"Error \"The stroke width must be in the range from 0 to 10\" thrown in Intervention/image.","triggerScenarios":"Thrown at src/Typography/Font.php:177 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a stroke width between 0 and 10 to Font::strokeWidth()","Clamp dynamic values with max(0, min(10, $width))","Validate user input before configuring the font"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5598b9e39751c34afc5cdee84abef77f92c26f68","analyzedAt":"2026-08-23T02:17:31.068Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}