From 929b36be52e9d633f3d9025dd22e0e96959982c2 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Fri, 9 Sep 2016 12:21:22 +0100 Subject: [PATCH] Improve command output from nothing --- app/Console/Commands/SecurityCheck.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/SecurityCheck.php b/app/Console/Commands/SecurityCheck.php index a1260e75..c2888b0f 100644 --- a/app/Console/Commands/SecurityCheck.php +++ b/app/Console/Commands/SecurityCheck.php @@ -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; } }