Skip to content

Commit

Permalink
Fix PHPStan issues (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry authored Jul 14, 2022
1 parent cb30cae commit 737a982
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/BinCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ private function executeInNamespace(
$this->logger->logDebug(
sprintf(
'Running <info>`@composer %s`</info>.',
$namespaceInput
$namespaceInput->__toString()
)
);

Expand Down
6 changes: 3 additions & 3 deletions src/BinInputFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static function createInput(
'/^(?<preBinOptions>.+)?bin (?:(?<preBinOptions2>.+?) )?(?:%1$s|\'%1$s\') (?<binCommand>.+?)(?<extraInput> -- .*)?$/',
preg_quote($namespace, '/')
),
(string) $previousInput,
$previousInput->__toString(),
$matches
);

Expand Down Expand Up @@ -62,7 +62,7 @@ public static function createNamespaceInput(InputInterface $previousInput): Inpu
{
$matchResult = preg_match(
'/^(.+?\s?)(--(?: .+)?)?$/',
(string) $previousInput,
$previousInput->__toString(),
$matches
);

Expand Down Expand Up @@ -91,7 +91,7 @@ public static function createForwardedCommandInput(InputInterface $input): Input
return new StringInput(
sprintf(
'bin all %s',
(string) $input
$input->__toString()
)
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/InvalidBinInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <namespaceName> <commandToExecuteInBinNamespace>", for example "bin all update --prefer-lowest".',
$input
$input->__toString()
)
);
}
Expand All @@ -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()
)
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ protected function onForwardedCommand(
$this->logger->logDebug(
sprintf(
'Original input: <comment>%s</comment>.',
$input
$input->__toString()
)
);

Expand Down
4 changes: 3 additions & 1 deletion tests/BinCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 737a982

Please sign in to comment.