{"record":{"id":"eed4f88abcbaf283","repo":"Intervention/image","slug":"decoder-must-implement-intervention-image-interfac","errorCode":null,"errorMessage":"Decoder must implement Intervention\\Image\\Interfaces\\DecoderInterface","messagePattern":"Decoder must implement Intervention\\\\Image\\\\Interfaces\\\\DecoderInterface","errorType":"exception","errorClass":"Intervention\\Image\\Exceptions\\InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/InputHandler.php","lineNumber":146,"sourceCode":"     */\n    private function decoders(): Generator\n    {\n        foreach ($this->decoders as $decoder) {\n            yield $this->decoder($decoder);\n        }\n    }\n\n    /**\n     * Resolve the given classname or object to a decoder object.\n     *\n     * @throws InvalidArgumentException\n     * @throws DriverException\n     */\n    private function decoder(string|DecoderInterface $decoder): DecoderInterface\n    {\n        if (is_string($decoder)) {\n            if (!is_subclass_of($decoder, DecoderInterface::class)) {\n                throw new InvalidArgumentException('Decoder must implement ' . DecoderInterface::class);\n            }\n\n            $decoder = new $decoder();\n        }\n\n        if ($this->driver === null) {\n            return $decoder;\n        }\n\n        try {\n            return $this->driver->specializeDecoder($decoder);\n        } catch (NotSupportedException $e) {\n            throw new DriverException(\n                'Failed to resolve decoder ' . $decoder::class . ' with driver ' . $this->driver::class,\n                previous: $e,\n            );\n        }\n    }","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/Intervention/image/blob/5598b9e39751c34afc5cdee84abef77f92c26f68/src/InputHandler.php#L128-L164","documentation":"Error \"Decoder must implement Intervention\\Image\\Interfaces\\DecoderInterface\" thrown in Intervention/image.","triggerScenarios":"Thrown at src/InputHandler.php:146 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the custom decoder class implements Intervention\\Image\\Interfaces\\DecoderInterface","Check the use-statement/namespace of your decoder so the correct interface is implemented","Register decoders as class names of valid implementations, not arbitrary callables"],"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"}