{"record":{"id":"81be24efbd1c2284","repo":"symfony/process","slug":"the-s-method-cannot-be-called-when-using-s","errorCode":null,"errorMessage":"The \"%s()\" method cannot be called when using \"%s\".","messagePattern":"The \"(.+?)\\(\\)\" method cannot be called when using \"(.+?)\"\\.","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"PhpProcess.php","lineNumber":57,"sourceCode":"        if (null === $php) {\n            $executableFinder = new PhpExecutableFinder();\n            $php = $executableFinder->find(false);\n            $php = false === $php ? null : array_merge([$php], $executableFinder->findArguments());\n        }\n        if ('phpdbg' === \\PHP_SAPI) {\n            $file = tempnam(sys_get_temp_dir(), 'dbg');\n            file_put_contents($file, $script);\n            register_shutdown_function('unlink', $file);\n            $php[] = $file;\n            $script = null;\n        }\n\n        parent::__construct($php, $cwd, $env, $script, $timeout);\n    }\n\n    public static function fromShellCommandline(string $command, ?string $cwd = null, ?array $env = null, mixed $input = null, ?float $timeout = 60): static\n    {\n        throw new LogicException(\\sprintf('The \"%s()\" method cannot be called when using \"%s\".', __METHOD__, self::class));\n    }\n\n    /**\n     * @param (callable('out'|'err', string):void)|null $callback\n     * @param EnvArray                                  $env\n     */\n    public function start(?callable $callback = null, array $env = []): void\n    {\n        if (null === $this->getCommandLine()) {\n            throw new RuntimeException('Unable to find the PHP executable.');\n        }\n\n        parent::start($callback, $env);\n    }\n}\n","sourceCodeStart":39,"sourceCodeEnd":73,"githubUrl":"https://github.com/symfony/process/blob/99b85026db14a68f02c6f3eeb01a1170ca25c491/PhpProcess.php#L39-L73","documentation":"Static guard in PhpProcess::fromShellCommandline: PhpProcess runs PHP scripts directly and has no shell commandline representation, so calling this inherited factory is unsupported and always throws a LogicException naming the method and class.","triggerScenarios":"Thrown at PhpProcess.php:57 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use the PhpProcess constructor with a script file/contents instead","Use the regular Process class with fromShellCommandline() for shell commands"],"exampleFix":null,"handlingStrategy":"validation","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"}