{"record":{"id":"18ee9ff6517a7e66","repo":"symfony/translation","slug":"please-provide-a-filename-or-pipe-file-content-to-stdin","errorCode":null,"errorMessage":"Please provide a filename or pipe file content to STDIN.","messagePattern":"Please provide a filename or pipe file content to STDIN\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"Command/XliffLintCommand.php","lineNumber":97,"sourceCode":"\n                EOF\n            )\n        ;\n    }\n\n    protected function execute(InputInterface $input, OutputInterface $output): int\n    {\n        $io = new SymfonyStyle($input, $output);\n        $filenames = (array) $input->getArgument('filename');\n        $this->format = $input->getOption('format') ?? (GithubActionReporter::isGithubActionEnvironment() ? 'github' : 'txt');\n        $this->displayCorrectFiles = $output->isVerbose();\n\n        if (['-'] === $filenames) {\n            return $this->display($io, [$this->validate(file_get_contents('php://stdin'))]);\n        }\n\n        if (!$filenames) {\n            throw new RuntimeException('Please provide a filename or pipe file content to STDIN.');\n        }\n\n        $filesInfo = [];\n        foreach ($filenames as $filename) {\n            if (!$this->isReadable($filename)) {\n                throw new RuntimeException(\\sprintf('File or directory \"%s\" is not readable.', $filename));\n            }\n\n            foreach ($this->getFiles($filename) as $file) {\n                $filesInfo[] = $this->validate(file_get_contents($file), $file);\n            }\n        }\n\n        return $this->display($io, $filesInfo);\n    }\n\n    private function validate(string $content, ?string $file = null): array\n    {","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/symfony/translation/blob/ae9e8a51bc29780d63c7f9efd6005d7c875e100b/Command/XliffLintCommand.php#L79-L115","documentation":"Sentinel error in XliffLintCommand::execute(): no filename argument was given and nothing was piped to STDIN, so there is no XLIFF input to lint. The command requires either one or more file paths/directories as the 'filename' argument or content streamed via '-'/STDIN; with neither it raises a RuntimeException.","triggerScenarios":"Thrown at Command/XliffLintCommand.php:97 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass file or directory arguments: php bin/console lint:xliff translations/messages.en.xliff.","Pipe content to STDIN: cat file.xliff | php bin/console lint:xliff - (or no args with stdin).","In CI, ensure the file glob expands to at least one existing path before invoking the linter."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ae9e8a51bc29780d63c7f9efd6005d7c875e100b","analyzedAt":"2026-09-15T22:29:15.305Z","contentChangedAt":"2026-09-15T22:29:15.305Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}