Skip to content

Commit

Permalink
Fix PHP 8.* with Composer 2.2.* [TypeError] Version Check Composer Co…
Browse files Browse the repository at this point in the history
…mmand execute must be of the type int #50
  • Loading branch information
Natshah committed Jul 13, 2022
1 parent c17531c commit 1319765
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Commands/RefactorComposerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/Commands/VersionCheckComposerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand Down

0 comments on commit 1319765

Please sign in to comment.