Skip to content

Commit

Permalink
PSR12 and Object Calisthenics (#1161)
Browse files Browse the repository at this point in the history
* PSR12 and Object Calisthenics
  • Loading branch information
viniciuseneas authored and siad007 committed Oct 19, 2019
1 parent e43139e commit b88e5a5
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions classes/phing/listener/DefaultLogger.php
Expand Up @@ -159,20 +159,19 @@ public function buildStarted(BuildEvent $event)
*/
public function buildFinished(BuildEvent $event)
{
$msg = PHP_EOL . $this->getBuildSuccessfulMessage() . PHP_EOL;
$error = $event->getException();
if ($error === null) {
$msg = PHP_EOL . $this->getBuildSuccessfulMessage() . PHP_EOL;
} else {

if ($error !== null) {
$msg = PHP_EOL . $this->getBuildFailedMessage() . PHP_EOL;

self::throwableMessage($msg, $error, Project::MSG_VERBOSE <= $this->msgOutputLevel);
}
$msg .= PHP_EOL . "Total time: " . static::formatTime(Phing::currentTimeMillis() - $this->startTime) . PHP_EOL;

if ($error === null) {
$this->printMessage($msg, $this->out, Project::MSG_VERBOSE);
} else {
$this->printMessage($msg, $this->err, Project::MSG_ERR);
}
$error === null
? $this->printMessage($msg, $this->out, Project::MSG_VERBOSE)
: $this->printMessage($msg, $this->err, Project::MSG_ERR);
}

public static function throwableMessage(&$msg, $error, $verbose)
Expand Down

0 comments on commit b88e5a5

Please sign in to comment.