Browse Source

[Scrutinizer] Fix Major issues

pull/1/head
Andrés Montañez 8 years ago
parent
commit
aa47edbc1b
  1. 2
      src/Command/BuiltIn/DeployCommand.php
  2. 4
      src/Runtime/Runtime.php
  3. 4
      src/Task/BuiltIn/FS/AbstractFileTask.php

2
src/Command/BuiltIn/DeployCommand.php

@ -173,7 +173,7 @@ class DeployCommand extends AbstractCommand
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()));
} else {
$output->writeln(sprintf(' Starting <fg=black;options=bold>%s</> tasks:', $this->getStageName()));

4
src/Runtime/Runtime.php

@ -49,7 +49,7 @@ class Runtime
/**
* @var string|null The host being deployed to
*/
protected $workingHost;
protected $workingHost = null;
/**
* @var string|null The Release ID
@ -420,7 +420,7 @@ class Runtime
}
$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);
} elseif ($jail) {
$cmdDelegate = sprintf('cd %s && %s', $hostPath, $cmdDelegate);

4
src/Task/BuiltIn/FS/AbstractFileTask.php

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

Loading…
Cancel
Save