diff --git a/EventListener/ErrorListener.php b/EventListener/ErrorListener.php index 212ad1d96..783c10793 100644 --- a/EventListener/ErrorListener.php +++ b/EventListener/ErrorListener.php @@ -40,7 +40,9 @@ public function onConsoleError(ConsoleErrorEvent $event) $error = $event->getError(); if (!$inputString = $this->getInputString($event)) { - return $this->logger->error('An error occurred while using the console. Message: "{message}"', ['exception' => $error, 'message' => $error->getMessage()]); + $this->logger->error('An error occurred while using the console. Message: "{message}"', ['exception' => $error, 'message' => $error->getMessage()]); + + return; } $this->logger->error('Error thrown while running command "{command}". Message: "{message}"', ['exception' => $error, 'command' => $inputString, 'message' => $error->getMessage()]); @@ -59,7 +61,9 @@ public function onConsoleTerminate(ConsoleTerminateEvent $event) } if (!$inputString = $this->getInputString($event)) { - return $this->logger->debug('The console exited with code "{code}"', ['code' => $exitCode]); + $this->logger->debug('The console exited with code "{code}"', ['code' => $exitCode]); + + return; } $this->logger->debug('Command "{command}" exited with code "{code}"', ['command' => $inputString, 'code' => $exitCode]); diff --git a/Input/ArgvInput.php b/Input/ArgvInput.php index cc1f6079e..b0c167d69 100644 --- a/Input/ArgvInput.php +++ b/Input/ArgvInput.php @@ -288,6 +288,8 @@ public function getFirstArgument() return $token; } + + return null; } /** diff --git a/Input/ArrayInput.php b/Input/ArrayInput.php index 9f8f93a65..a04b6b68e 100644 --- a/Input/ArrayInput.php +++ b/Input/ArrayInput.php @@ -46,6 +46,8 @@ public function getFirstArgument() return $value; } + + return null; } /** diff --git a/Style/SymfonyStyle.php b/Style/SymfonyStyle.php index e0ced01b2..4291ada8f 100644 --- a/Style/SymfonyStyle.php +++ b/Style/SymfonyStyle.php @@ -355,7 +355,9 @@ private function autoPrependBlock() $chars = substr(str_replace(PHP_EOL, "\n", $this->bufferedOutput->fetch()), -2); if (!isset($chars[0])) { - return $this->newLine(); //empty history, so we should start with a new line. + $this->newLine(); //empty history, so we should start with a new line. + + return; } //Prepend new line for each non LF chars (This means no blank line was output before) $this->newLine(2 - substr_count($chars, "\n"));