diff --git a/src/Output/Projects.php b/src/Output/Projects.php index d1b7913..06b73da 100644 --- a/src/Output/Projects.php +++ b/src/Output/Projects.php @@ -26,14 +26,14 @@ public function all(OutputInterface $output, array $response) $response, function ($key, $value) use ($output) { if ('public' === $key) { - return $value === 1 ? 'Yes' : 'No'; + return $value == 1 ? 'Yes' : 'No'; } if (!in_array($key, ['out_number', 'licenses_red', 'licenses_unknown'], true)) { return $value; } - return $this->printBoolean($output, $value, 'No', $value > 0, false); + return $this->printBoolean($output, $value > 0 ? $value : 'No', $value, !$value, false); } ); } @@ -119,7 +119,7 @@ private function output(OutputInterface $output, array $response) $response, function ($key, $value) use ($output) { if (in_array($key, ['Outdated', 'Bad Licenses', 'Unknown Licenses'], true)) { - return $this->printBoolean($output, $value, 'No', $value > 0, false); + return $this->printBoolean($output, $value == 0 ? 'No' : $value, $value, !$value, false); } return $value; @@ -135,14 +135,17 @@ function ($key, $value) use ($output) { return implode(', ', array_column($value, 'name')); } if ('stable' === $key) { - return $this->printBoolean($output, 'No', 'Yes', !$value, false); + return $this->printBoolean($output, 'No', 'Yes', $value, false); } if ('outdated' === $key) { - return $this->printBoolean($output, 'Yes', 'No', $value, false); + return $this->printBoolean($output, 'No', 'Yes', !$value, false); } if ('security_vulnerabilities' === $key) { - return $this->printBoolean($output, 'No', implode(', ', array_column($value, 'cve')), count($value) === 0, false); + if (is_array($value)) { + return $this->printBoolean($output, 'No', implode(', ', array_column($value, 'cve')), count($value) === 0, false); + } + return $this->printBoolean($output, 'No', 'Yes', true, false); } return $value;