[Scrutinizer] Fix Major issues

This commit is contained in:
Andrés Montañez 2017-01-24 17:28:37 -03:00
parent 881cf7a3a9
commit aa47edbc1b
3 changed files with 5 additions and 5 deletions

View file

@ -173,7 +173,7 @@ class DeployCommand extends AbstractCommand
return true; return true;
} }
if ($this->runtime->getWorkingHost()) { if ($this->runtime->getWorkingHost() !== null) {
$output->writeln(sprintf(' Starting <fg=black;options=bold>%s</> tasks on host <fg=black;options=bold>%s</>:', $this->getStageName(), $this->runtime->getWorkingHost())); $output->writeln(sprintf(' Starting <fg=black;options=bold>%s</> tasks on host <fg=black;options=bold>%s</>:', $this->getStageName(), $this->runtime->getWorkingHost()));
} else { } else {
$output->writeln(sprintf(' Starting <fg=black;options=bold>%s</> tasks:', $this->getStageName())); $output->writeln(sprintf(' Starting <fg=black;options=bold>%s</> tasks:', $this->getStageName()));

View file

@ -49,7 +49,7 @@ class Runtime
/** /**
* @var string|null The host being deployed to * @var string|null The host being deployed to
*/ */
protected $workingHost; protected $workingHost = null;
/** /**
* @var string|null The Release ID * @var string|null The Release ID
@ -420,7 +420,7 @@ class Runtime
} }
$hostPath = rtrim($this->getEnvOption('host_path'), '/'); $hostPath = rtrim($this->getEnvOption('host_path'), '/');
if ($jail && $this->getReleaseId()) { if ($jail && $this->getReleaseId() !== null) {
$cmdDelegate = sprintf('cd %s/releases/%s && %s', $hostPath, $this->getReleaseId(), $cmdDelegate); $cmdDelegate = sprintf('cd %s/releases/%s && %s', $hostPath, $this->getReleaseId(), $cmdDelegate);
} elseif ($jail) { } elseif ($jail) {
$cmdDelegate = sprintf('cd %s && %s', $hostPath, $cmdDelegate); $cmdDelegate = sprintf('cd %s && %s', $hostPath, $cmdDelegate);

View file

@ -59,11 +59,11 @@ abstract class AbstractFileTask extends AbstractTask
'%environment%' => $this->runtime->getEnvironment(), '%environment%' => $this->runtime->getEnvironment(),
]; ];
if ($this->runtime->getWorkingHost()) { if ($this->runtime->getWorkingHost() !== null) {
$mapping['%host%'] = $this->runtime->getWorkingHost(); $mapping['%host%'] = $this->runtime->getWorkingHost();
} }
if ($this->runtime->getReleaseId()) { if ($this->runtime->getReleaseId() !== null) {
$mapping['%release%'] = $this->runtime->getReleaseId(); $mapping['%release%'] = $this->runtime->getReleaseId();
} }