{"record":{"id":"8a8ad3e56f2e6efd","repo":"symfony/process","slug":"s-is-closed","errorCode":null,"errorMessage":"\"%s\" is closed.","messagePattern":"\"(.+?)\" is closed\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"InputStream.php","lineNumber":49,"sourceCode":"     */\n    public function onEmpty(?callable $onEmpty = null): void\n    {\n        $this->onEmpty = null !== $onEmpty ? $onEmpty(...) : null;\n    }\n\n    /**\n     * Appends an input to the write buffer.\n     *\n     * @param resource|string|int|float|bool|\\Traversable|null $input The input to append as scalar,\n     *                                                                stream resource or \\Traversable\n     */\n    public function write(mixed $input): void\n    {\n        if (null === $input) {\n            return;\n        }\n        if ($this->isClosed()) {\n            throw new RuntimeException(\\sprintf('\"%s\" is closed.', static::class));\n        }\n        $this->input[] = ProcessUtils::validateInput(__METHOD__, $input);\n    }\n\n    /**\n     * Closes the write buffer.\n     */\n    public function close(): void\n    {\n        $this->open = false;\n    }\n\n    /**\n     * Tells whether the write buffer is closed or not.\n     */\n    public function isClosed(): bool\n    {\n        return !$this->open;","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/symfony/process/blob/99b85026db14a68f02c6f3eeb01a1170ca25c491/InputStream.php#L31-L67","documentation":"Thrown from InputStream::write when attempting to append input after the stream has been closed (e.g. the underlying process ended or close() was called). Writes to a closed stream cannot be buffered, so a RuntimeException is raised.","triggerScenarios":"Thrown at InputStream.php:49 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Call isClosed() before writing to the stream","Restructure code so writes finish before the process terminates","Wrap write() calls in try-catch and discard input for closed streams"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"99b85026db14a68f02c6f3eeb01a1170ca25c491","analyzedAt":"2026-09-14T11:23:33.683Z","contentChangedAt":"2026-09-14T11:23:33.683Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}