Skip to content

Commit eafa9b6

Browse files
Require exact match when reading from stdin with a dash
1 parent 6b1d00b commit eafa9b6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Command/LintCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
8686
$this->format = $input->getOption('format');
8787
$this->displayCorrectFiles = $output->isVerbose();
8888
$flags = $input->getOption('parse-tags') ? Yaml::PARSE_CUSTOM_TAGS : 0;
89-
$hasStdin = '-' === ($filenames[0] ?? '');
89+
$hasStdin = ['-'] === $filenames;
9090

91-
if ($hasStdin || 0 === \count($filenames)) {
91+
if ($hasStdin || !$filenames) {
9292
if (!$hasStdin && 0 !== ftell(STDIN)) { // remove 0 !== ftell(STDIN) check in 5.0
9393
throw new RuntimeException('Please provide a filename or pipe file content to STDIN.');
9494
}

0 commit comments

Comments
 (0)