Skip to content

Commit

Permalink
Replace condition for module input. Improve the code presentation (#3855
Browse files Browse the repository at this point in the history
)
  • Loading branch information
LOBsTerr authored and jmolivas committed Apr 22, 2018
1 parent b5daec5 commit 390a131
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Command/Shared/ProjectDownloadTrait.php
Expand Up @@ -37,7 +37,7 @@ public function modulesQuestion()
true
);

if (empty($moduleName) && is_numeric($moduleName)) {
if (empty($moduleName) || is_numeric($moduleName)) {
break;
}

Expand Down Expand Up @@ -166,7 +166,7 @@ public function downloadProject($project, $version, $type, $path = null)

$this->getIo()->comment(
sprintf(
$this->trans('commands.'.$commandKey.'.messages.downloading'),
$this->trans('commands.' . $commandKey . '.messages.downloading'),
$project,
$version
)
Expand Down Expand Up @@ -201,7 +201,7 @@ public function downloadProject($project, $version, $type, $path = null)
}

$zippy = Zippy::load();
if (PHP_OS === "WIN32" || PHP_OS === "WINNT") {
if (PHP_OS === 'WIN32' || PHP_OS === 'WINNT') {
$container = AdapterContainer::load();
$container['Drupal\\Console\\Zippy\\Adapter\\TarGzGNUTarForWindowsAdapter'] = function ($container) {
return TarGzGNUTarForWindowsAdapter::newInstance(
Expand Down Expand Up @@ -263,17 +263,17 @@ public function releasesQuestion($project, $latest = false, $stable = false)

$this->getIo()->comment(
sprintf(
$this->trans('commands.'.$commandKey.'.messages.getting-releases'),
$this->trans('commands.' . $commandKey . '.messages.getting-releases'),
implode(',', [$project])
)
);

$releases = $this->drupalApi->getProjectReleases($project, $latest?1:15, $stable);
$releases = $this->drupalApi->getProjectReleases($project, $latest? 1 : 15, $stable);

if (!$releases) {
$this->getIo()->error(
sprintf(
$this->trans('commands.'.$commandKey.'.messages.no-releases'),
$this->trans('commands.' . $commandKey . '.messages.no-releases'),
implode(',', [$project])
)
);
Expand All @@ -286,7 +286,7 @@ public function releasesQuestion($project, $latest = false, $stable = false)
}

$version = $this->getIo()->choice(
$this->trans('commands.'.$commandKey.'.messages.select-release'),
$this->trans('commands.' . $commandKey . '.messages.select-release'),
$releases
);

Expand Down

0 comments on commit 390a131

Please sign in to comment.