diff --git a/src/BinCommand.php b/src/BinCommand.php index 2e97f5d..bbfeeea 100644 --- a/src/BinCommand.php +++ b/src/BinCommand.php @@ -217,7 +217,7 @@ private function executeInNamespace( $this->logger->logDebug( sprintf( 'Running `@composer %s`.', - $namespaceInput + $namespaceInput->__toString() ) ); diff --git a/src/BinInputFactory.php b/src/BinInputFactory.php index 90fab1b..6f60d88 100644 --- a/src/BinInputFactory.php +++ b/src/BinInputFactory.php @@ -31,7 +31,7 @@ public static function createInput( '/^(?.+)?bin (?:(?.+?) )?(?:%1$s|\'%1$s\') (?.+?)(? -- .*)?$/', preg_quote($namespace, '/') ), - (string) $previousInput, + $previousInput->__toString(), $matches ); @@ -62,7 +62,7 @@ public static function createNamespaceInput(InputInterface $previousInput): Inpu { $matchResult = preg_match( '/^(.+?\s?)(--(?: .+)?)?$/', - (string) $previousInput, + $previousInput->__toString(), $matches ); @@ -91,7 +91,7 @@ public static function createForwardedCommandInput(InputInterface $input): Input return new StringInput( sprintf( 'bin all %s', - (string) $input + $input->__toString() ) ); } diff --git a/src/InvalidBinInput.php b/src/InvalidBinInput.php index a966b60..be48698 100644 --- a/src/InvalidBinInput.php +++ b/src/InvalidBinInput.php @@ -15,7 +15,7 @@ public static function forBinInput(InputInterface $input): self return new self( sprintf( 'Could not parse the input "%s". Expected the input to be in the format "bin ", for example "bin all update --prefer-lowest".', - $input + $input->__toString() ) ); } @@ -25,7 +25,7 @@ public static function forNamespaceInput(InputInterface $input): self return new self( sprintf( 'Could not parse the input (executed within the namespace) "%s".', - $input + $input->__toString() ) ); } diff --git a/src/Plugin.php b/src/Plugin.php index dc65124..3e24295 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -143,7 +143,7 @@ protected function onForwardedCommand( $this->logger->logDebug( sprintf( 'Original input: %s.', - $input + $input->__toString() ) ); diff --git a/tests/BinCommandTest.php b/tests/BinCommandTest.php index 3cbad4e..c226657 100644 --- a/tests/BinCommandTest.php +++ b/tests/BinCommandTest.php @@ -60,7 +60,9 @@ protected function setUp(): void chdir($tmpDir); // On OSX sys_get_temp_dir() may return a symlink - $this->tmpDir = realpath($tmpDir); + $tmpDirRealPath = realpath($tmpDir); + self::assertNotFalse($tmpDirRealPath); + $this->tmpDir = $tmpDirRealPath; file_put_contents( $this->tmpDir.'/composer.json',