Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix inconsistent return points.
  • Loading branch information
derrabus authored and nicolas-grekas committed Aug 20, 2019
1 parent 191227e commit e5368e4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
8 changes: 6 additions & 2 deletions EventListener/ErrorListener.php
Expand Up @@ -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()]);
Expand All @@ -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]);
Expand Down
2 changes: 2 additions & 0 deletions Input/ArgvInput.php
Expand Up @@ -288,6 +288,8 @@ public function getFirstArgument()

return $token;
}

return null;
}

/**
Expand Down
2 changes: 2 additions & 0 deletions Input/ArrayInput.php
Expand Up @@ -46,6 +46,8 @@ public function getFirstArgument()

return $value;
}

return null;
}

/**
Expand Down
4 changes: 3 additions & 1 deletion Style/SymfonyStyle.php
Expand Up @@ -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"));
Expand Down

0 comments on commit e5368e4

Please sign in to comment.