src/Viserio/Component/Parser/Command/AbstractLintCommand.php
public function handle(): int
    {
        $filename            = $this->argument('filename');
        $format              = $this->option('format');
        $displayCorrectFiles = $this->getOutput()->isVerbose();

        if (! $filename) {
            if (! $stdin = $this->getStdin()) {
                throw new RuntimeException('Please provide a filename or pipe file content to STDIN.');
            }

            return $this->display([$this->validate($stdin)], $format, $displayCorrectFiles);
        }

        if (! \is_readable($filename)) {
            throw new RuntimeException(\sprintf('File or directory [%s] is not readable.', $filename));
        }

        $filesInfo = [];

        foreach ($this->getFiles($filename) as $file) {
            $filesInfo[] = $this->validate(\file_get_contents($file), $file);
        }

        return $this->display($filesInfo, $format, $displayCorrectFiles);
    }
public function handle(): int
    {
        $filename            = $this->argument('filename');
        $format              = $this->option('format');
        $displayCorrectFiles = $this->getOutput()->isVerbose();

        if (! $filename) {
            if (! $stdin = $this->getStdin()) {
                throw new RuntimeException('Please provide a filename or pipe file content to STDIN.');
            }

            return $this->display([$this->validate($stdin)], $format, $displayCorrectFiles);
        }

        if (! \is_readable($filename)) {
            throw new RuntimeException(\sprintf('File or directory [%s] is not readable.', $filename));
        }

        $filesInfo = [];

        foreach ($this->getFiles($filename) as $file) {
            $filesInfo[] = $this->validate(\file_get_contents($file), $file);
        }

        return $this->display($filesInfo, $format, $displayCorrectFiles);
    }
{@inheritdoc}

@throws \Viserio\Component\Contract\Parser\Exception\RuntimeException