From 131976516051ec0bd45f77aac7bc262098194201 Mon Sep 17 00:00:00 2001 From: Rajab Natshah Date: Wed, 13 Jul 2022 17:15:59 +0300 Subject: [PATCH] Fix PHP 8.* with Composer 2.2.* [TypeError] Version Check Composer Command execute must be of the type int #50 --- src/Commands/RefactorComposerCommand.php | 6 +++--- src/Commands/VersionCheckComposerCommand.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Commands/RefactorComposerCommand.php b/src/Commands/RefactorComposerCommand.php index 4de6f1a..d6a42e5 100644 --- a/src/Commands/RefactorComposerCommand.php +++ b/src/Commands/RefactorComposerCommand.php @@ -58,10 +58,10 @@ protected function execute(InputInterface $input, OutputInterface $output) { $path = $input->getArgument('file'); $drupalPath = $input->getArgument('drupal-path'); $this->generate($path, $drupalPath); - return 1; - } catch (\Exception $e) { - throw new \Exception('Version Check Composer Command: ' . $e->getMessage(), 0, $e); return 0; + } catch (\Exception $e) { + throw new \Exception('Refactor Composer Command: ' . $e->getMessage(), 0, $e); + return $e->getCode(); } } diff --git a/src/Commands/VersionCheckComposerCommand.php b/src/Commands/VersionCheckComposerCommand.php index 820edf9..70892d3 100644 --- a/src/Commands/VersionCheckComposerCommand.php +++ b/src/Commands/VersionCheckComposerCommand.php @@ -53,10 +53,10 @@ protected function execute(InputInterface $input, OutputInterface $output) { try { $type = $input->getArgument('type'); $this->getVersion($type); - return 1; + return 0; } catch (\Exception $e) { throw new \Exception('Version Check Composer Command: ' . $e->getMessage(), 0, $e); - return 0; + return $e->getCode(); } }