{"record":{"id":"039acecb40ffbe02","repo":"symfony/translation","slug":"supported-formats-are-s","errorCode":null,"errorMessage":"Supported formats are \"%s\".","messagePattern":"Supported formats are \"(.+?)\"\\.","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"Command/XliffLintCommand.php","lineNumber":165,"sourceCode":"                'line' => $xmlError['line'],\n                'column' => $xmlError['column'],\n                'message' => $xmlError['message'],\n            ];\n        }\n\n        libxml_clear_errors();\n        libxml_use_internal_errors($internal);\n\n        return ['file' => $file, 'valid' => !$errors, 'messages' => $errors];\n    }\n\n    private function display(SymfonyStyle $io, array $files): int\n    {\n        return match ($this->format) {\n            'txt' => $this->displayTxt($io, $files),\n            'json' => $this->displayJson($io, $files),\n            'github' => $this->displayTxt($io, $files, true),\n            default => throw new InvalidArgumentException(\\sprintf('Supported formats are \"%s\".', implode('\", \"', $this->getAvailableFormatOptions()))),\n        };\n    }\n\n    private function displayTxt(SymfonyStyle $io, array $filesInfo, bool $errorAsGithubAnnotations = false): int\n    {\n        $countFiles = \\count($filesInfo);\n        $erroredFiles = 0;\n        $githubReporter = $errorAsGithubAnnotations ? new GithubActionReporter($io) : null;\n\n        foreach ($filesInfo as $info) {\n            if ($info['valid'] && $this->displayCorrectFiles) {\n                $io->comment('<info>OK</info>'.($info['file'] ? \\sprintf(' in %s', $info['file']) : ''));\n            } elseif (!$info['valid']) {\n                ++$erroredFiles;\n                $io->text('<error> ERROR </error>'.($info['file'] ? \\sprintf(' in %s', $info['file']) : ''));\n                $io->listing(array_map(static function ($error) use ($info, $githubReporter) {\n                    // general document errors have a '-1' line number\n                    $line = -1 === $error['line'] ? null : $error['line'];","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/symfony/translation/blob/ae9e8a51bc29780d63c7f9efd6005d7c875e100b/Command/XliffLintCommand.php#L147-L183","documentation":"Format validation in XliffLintCommand::display(): the --format option was set to something other than 'txt', 'json' or 'github', and the match expression has no default branch, so producing the lint report is impossible. Note that 'github' is auto-selected in GitHub Actions environments, and the InvalidArgumentException names the supported formats in its message.","triggerScenarios":"Thrown at Command/XliffLintCommand.php:165 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run with one of --format=txt, --format=json or --format=github.","Remove the explicit --format option to let the default (github in GitHub Actions, otherwise txt) apply.","Check scripts/CI wrappers for a misspelled format value."],"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"}