Improve command output from nothing

This commit is contained in:
Jonny Barnes 2016-09-09 12:21:22 +01:00
parent 4060e449a1
commit 929b36be52

View file

@ -48,6 +48,14 @@ class SecurityCheck extends Command
*/
public function handle()
{
return $this->securityChecker->check(base_path() . '/composer.lock');
$alerts = $this->securityChecker->check(base_path() . '/composer.lock');
if (count($alerts) === 0) {
$this->info('No security vulnerabilities found.');
return 0;
}
$this->error('vulnerabilities found');
return 1;
}
}