Skip to content

Commit

Permalink
Fixed error on bin/gpm plugin uninstall [#3207]
Browse files Browse the repository at this point in the history
  • Loading branch information
mahagr committed Feb 8, 2021
1 parent 7d95fb7 commit 1347c76
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* Fixed page save failing because of uploaded images [#3191](https://github.com/getgrav/grav/issues/3191)
* Fixed `Flex Pages` using only default language in frontend [#106](https://github.com/trilbymedia/grav-plugin-flex-objects/issues/106)
* Fixed empty `route()` and `raw_route()` when getting translated pages [#3184](https://github.com/getgrav/grav/pull/3184)
* Fixed error on `bin/gpm plugin uninstall` [#3207](https://github.com/getgrav/grav/issues/3207)

# v1.7.5
## 02/01/2021
Expand Down
18 changes: 10 additions & 8 deletions system/src/Grav/Console/Gpm/UninstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@

use Grav\Common\GPM\GPM;
use Grav\Common\GPM\Installer;
use Grav\Common\GPM\Local\Package;
use Grav\Common\GPM\Local;
use Grav\Common\GPM\Remote;
use Grav\Common\Grav;
use Grav\Console\GpmCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Question\ConfirmationQuestion;
use Throwable;
use function count;
use function in_array;
use function is_array;
Expand Down Expand Up @@ -113,7 +115,7 @@ protected function serve(): int
// Plugins need to be initialized in order to make clear-cache to work.
try {
$this->initializePlugins();
} catch (\Throwable $e) {
} catch (Throwable $e) {
$io->writeln("<red>Some plugins failed to initialize: {$e->getMessage()}</red>");
}

Expand Down Expand Up @@ -148,11 +150,11 @@ protected function serve(): int

/**
* @param string $slug
* @param Package $package
* @param Local\Package|Remote\Package $package
* @param bool $is_dependency
* @return bool
*/
private function uninstallPackage($slug, Package $package, $is_dependency = false): bool
private function uninstallPackage($slug, $package, $is_dependency = false): bool
{
$io = $this->getIO();

Expand Down Expand Up @@ -255,10 +257,10 @@ private function uninstallPackage($slug, Package $package, $is_dependency = fals

/**
* @param string $slug
* @param Package $package
* @param Local\Package|Remote\Package $package
* @return bool
*/
private function checkDestination(string $slug, Package $package): bool
private function checkDestination(string $slug, $package): bool
{
$io = $this->getIO();

Expand Down Expand Up @@ -297,10 +299,10 @@ private function checkDestination(string $slug, Package $package): bool
* Check if package exists
*
* @param string $slug
* @param Package $package
* @param Local\Package|Remote\Package $package
* @return int
*/
private function packageExists(string $slug, Package $package): int
private function packageExists(string $slug, $package): int
{
$path = Grav::instance()['locator']->findResource($package->package_type . '://' . $slug);
Installer::isValidDestination($path);
Expand Down

0 comments on commit 1347c76

Please sign in to comment.