toArray(); } $result = [ 'totals' => [ 'violations' => count($violations), 'baselined' => $baselinedCount ], 'violations' => $serialized ]; $io->write((string)json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)); return empty($violations) ? Command::SUCCESS : Command::FAILURE; } }