From 73fd0f22e860494f753bb38e848f7c54f07e9d6e Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 8 Jun 2022 20:03:59 +0200 Subject: [PATCH] Fix phpstan 8.1 build --- src/Composer/Command/GlobalCommand.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Composer/Command/GlobalCommand.php b/src/Composer/Command/GlobalCommand.php index e9195ca1e..3654e868a 100644 --- a/src/Composer/Command/GlobalCommand.php +++ b/src/Composer/Command/GlobalCommand.php @@ -91,7 +91,8 @@ EOT */ public function run(InputInterface $input, OutputInterface $output): int { - if (!method_exists($input, '__toString')) { + // TODO remove for Symfony 6+ as it is then in the interface + if (!method_exists($input, '__toString')) { // @phpstan-ignore-line throw new \LogicException('Expected an Input instance that is stringable, got '.get_class($input)); } @@ -119,7 +120,8 @@ EOT private function prepareSubcommandInput(InputInterface $input, bool $quiet = false): StringInput { - if (!method_exists($input, '__toString')) { + // TODO remove for Symfony 6+ as it is then in the interface + if (!method_exists($input, '__toString')) { // @phpstan-ignore-line throw new \LogicException('Expected an Input instance that is stringable, got '.get_class($input)); }