From 8b49eca549cf57411aaf4e6b5e718e36d287049c Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 18 Sep 2015 10:27:36 -0600 Subject: [PATCH] style formatting updates --- system/src/Grav/Console/Gpm/UpdateCommand.php | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/system/src/Grav/Console/Gpm/UpdateCommand.php b/system/src/Grav/Console/Gpm/UpdateCommand.php index 79517300f..f5c3f9a1d 100644 --- a/system/src/Grav/Console/Gpm/UpdateCommand.php +++ b/system/src/Grav/Console/Gpm/UpdateCommand.php @@ -104,7 +104,7 @@ class UpdateCommand extends Command } $this->data = $this->gpm->getUpdatable(); - $onlyPackages = array_map('strtolower', $this->input->getArgument('package')); + $only_packages = array_map('strtolower', $this->input->getArgument('package')); if (!$this->data['total']) { $this->output->writeln("Nothing to update."); @@ -113,12 +113,12 @@ class UpdateCommand extends Command $this->output->write("Found " . $this->gpm->countInstalled() . " extensions installed of which " . $this->data['total'] . " need updating"); - $limitTo = $this->userInputPackages($onlyPackages); + $limit_to = $this->userInputPackages($only_packages); $this->output->writeln(''); unset($this->data['total']); - unset($limitTo['total']); + unset($limit_to['total']); // updates review @@ -127,7 +127,7 @@ class UpdateCommand extends Command $index = 0; foreach ($this->data as $packages) { foreach ($packages as $slug => $package) { - if (count($limitTo) && !array_key_exists($slug, $limitTo)) { + if (count($limit_to) && !array_key_exists($slug, $limit_to)) { continue; } @@ -166,35 +166,32 @@ class UpdateCommand extends Command '-d' => $this->destination, '-y' => true )); - $commandExec = $installCommand->run($args, $this->output); + $command_exec = $install_command->run($args, $this->output); - if ($commandExec != 0) { + if ($command_exec != 0) { $this->output->writeln("Error: An error occurred while trying to install the extensions"); exit; } - - // clear cache after successful upgrade - $this->clearCache(); } /** - * @param $onlyPackages + * @param $only_packages * * @return array */ - private function userInputPackages($onlyPackages) + private function userInputPackages($only_packages) { $found = ['total' => 0]; $ignore = []; - if (!count($onlyPackages)) { + if (!count($only_packages)) { $this->output->writeln(''); } else { - foreach ($onlyPackages as $onlyPackage) { - $find = $this->gpm->findPackage($onlyPackage); + foreach ($only_packages as $only_package) { + $find = $this->gpm->findPackage($only_package); if (!$find || !$this->gpm->isUpdatable($find->slug)) { - $name = isset($find->slug) ? $find->slug : $onlyPackage; + $name = isset($find->slug) ? $find->slug : $only_package; $ignore[$name] = $name; } else { $found[$find->slug] = $find;