You are here

private function LintCommand::displayJson in Lockr 7.3

1 call to LintCommand::displayJson()
LintCommand::display in vendor/symfony/yaml/Command/LintCommand.php

File

vendor/symfony/yaml/Command/LintCommand.php, line 166

Class

LintCommand
Validates YAML files syntax and outputs encountered errors.

Namespace

Symfony\Component\Yaml\Command

Code

private function displayJson(SymfonyStyle $io, array $filesInfo) {
  $errors = 0;
  array_walk($filesInfo, function (&$v) use (&$errors) {
    $v['file'] = (string) $v['file'];
    if (!$v['valid']) {
      ++$errors;
    }
  });
  $io
    ->writeln(json_encode($filesInfo, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
  return min($errors, 1);
}