diff --git a/extensions/package-manager/src/Command/CheckForUpdatesHandler.php b/extensions/package-manager/src/Command/CheckForUpdatesHandler.php index dbd95719f..a4cd34a54 100755 --- a/extensions/package-manager/src/Command/CheckForUpdatesHandler.php +++ b/extensions/package-manager/src/Command/CheckForUpdatesHandler.php @@ -57,13 +57,14 @@ class CheckForUpdatesHandler ]); $exitCode = $this->composer->run($input, $output); + $output = $output->fetch(); - $this->logger->log($output->fetch(), $exitCode); + $this->logger->log($output, $exitCode); if ($exitCode !== 0) { - throw new ComposerCommandFailedException('', $output->fetch()); + throw new ComposerCommandFailedException('', $output); } - return $this->lastUpdateCheck->save(json_decode($output->fetch(), true)); + return $this->lastUpdateCheck->save(json_decode($output, true)); } } diff --git a/extensions/package-manager/src/Command/GlobalUpdateHandler.php b/extensions/package-manager/src/Command/GlobalUpdateHandler.php index 53bc1331e..5e644a8b5 100644 --- a/extensions/package-manager/src/Command/GlobalUpdateHandler.php +++ b/extensions/package-manager/src/Command/GlobalUpdateHandler.php @@ -62,11 +62,12 @@ class GlobalUpdateHandler ]); $exitCode = $this->composer->run($input, $output); + $output = $output->fetch(); - $this->logger->log($output->fetch(), $exitCode); + $this->logger->log($output, $exitCode); if ($exitCode !== 0) { - throw new ComposerUpdateFailedException('*', $output->fetch()); + throw new ComposerUpdateFailedException('*', $output); } $this->commandDispatcher->dispatch( diff --git a/extensions/package-manager/src/Command/MinorFlarumUpdateHandler.php b/extensions/package-manager/src/Command/MinorFlarumUpdateHandler.php index 8e43aa62e..858dee4b1 100755 --- a/extensions/package-manager/src/Command/MinorFlarumUpdateHandler.php +++ b/extensions/package-manager/src/Command/MinorFlarumUpdateHandler.php @@ -64,11 +64,12 @@ class MinorFlarumUpdateHandler ]); $exitCode = $this->composer->run($input, $output); + $output = $output->fetch(); - $this->logger->log($output->fetch(), $exitCode); + $this->logger->log($output, $exitCode); if ($exitCode !== 0) { - throw new ComposerUpdateFailedException('flarum/*', $output->fetch()); + throw new ComposerUpdateFailedException('flarum/*', $output); } $this->lastUpdateCheck->forget('flarum/*', true); diff --git a/extensions/package-manager/src/Command/RemoveExtensionHandler.php b/extensions/package-manager/src/Command/RemoveExtensionHandler.php index dfaf29b6e..ef76c84c8 100755 --- a/extensions/package-manager/src/Command/RemoveExtensionHandler.php +++ b/extensions/package-manager/src/Command/RemoveExtensionHandler.php @@ -9,6 +9,8 @@ namespace SychO\PackageManager\Command; use Composer\Console\Application; use Flarum\Extension\ExtensionManager; use Illuminate\Contracts\Events\Dispatcher; +use SychO\PackageManager\Exception\ComposerCommandFailedException; +use SychO\PackageManager\Exception\ComposerUpdateFailedException; use SychO\PackageManager\Exception\ExtensionNotInstalledException; use SychO\PackageManager\Extension\Event\Removed; use SychO\PackageManager\OutputLogger; @@ -66,8 +68,13 @@ class RemoveExtensionHandler ]); $exitCode = $this->composer->run($input, $output); + $output = $output->fetch(); - $this->logger->log($output->fetch(), $exitCode); + $this->logger->log($output, $exitCode); + + if ($exitCode !== 0) { + throw new ComposerCommandFailedException($extension->name, $output); + } $this->events->dispatch( new Removed($extension) diff --git a/extensions/package-manager/src/Command/RequireExtensionHandler.php b/extensions/package-manager/src/Command/RequireExtensionHandler.php index 10dfd1658..216f0c712 100755 --- a/extensions/package-manager/src/Command/RequireExtensionHandler.php +++ b/extensions/package-manager/src/Command/RequireExtensionHandler.php @@ -78,11 +78,12 @@ class RequireExtensionHandler ]); $exitCode = $this->composer->run($input, $output); + $output = $output->fetch(); - $this->logger->log($output->fetch(), $exitCode); + $this->logger->log($output, $exitCode); if ($exitCode !== 0) { - throw new ComposerRequireFailedException($command->package, $output->fetch()); + throw new ComposerRequireFailedException($command->package, $output); } $this->events->dispatch( diff --git a/extensions/package-manager/src/Command/UpdateExtensionHandler.php b/extensions/package-manager/src/Command/UpdateExtensionHandler.php index b3c3e4d1f..0e99e34c1 100755 --- a/extensions/package-manager/src/Command/UpdateExtensionHandler.php +++ b/extensions/package-manager/src/Command/UpdateExtensionHandler.php @@ -90,11 +90,12 @@ class UpdateExtensionHandler ]); $exitCode = $this->composer->run($input, $output); + $output = $output->fetch(); - $this->logger->log($output->fetch(), $exitCode); + $this->logger->log($output, $exitCode); if ($exitCode !== 0) { - throw new ComposerUpdateFailedException($extension->name, $output->fetch()); + throw new ComposerUpdateFailedException($extension->name, $output); } $this->lastUpdateCheck->forget($extension->name);