Skip to content

Commit

Permalink
Fix some PHP 8.1 deprecation warnings, fixes #10008
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Jul 21, 2021
1 parent f5a03b9 commit 10ae1d7
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/Composer/DependencyResolver/Pool.php
Expand Up @@ -79,6 +79,7 @@ public function packageById($id)
/**
* Returns how many packages have been loaded into the pool
*/
#[\ReturnTypeWillChange]
public function count()
{
return \count($this->packages);
Expand Down
1 change: 1 addition & 0 deletions src/Composer/Repository/ArrayRepository.php
Expand Up @@ -283,6 +283,7 @@ public function getPackages()
*
* @return int Number of packages
*/
#[\ReturnTypeWillChange]
public function count()
{
if (null === $this->packages) {
Expand Down
11 changes: 0 additions & 11 deletions tests/Composer/Test/Platform/HhvmDetectorTest.php
Expand Up @@ -68,17 +68,6 @@ public function testHHVMVersionWhenExecutingInPHP()
self::assertSame(self::getVersionParser()->normalize($version), self::getVersionParser()->normalize($detectedVersion));
}

/** @runInSeparateProcess */
public function testHHVMVersionWhenRunningInHHVMWithMockedConstant()
{
if (!defined('HHVM_VERSION_ID')) {
define('HHVM_VERSION', '2.2.1');
define('HHVM_VERSION_ID', 20201);
}
$version = $this->hhvmDetector->getVersion();
self::assertSame(self::getVersionParser()->normalize(self::versionIdToVersion()), self::getVersionParser()->normalize($version));
}

private static function versionIdToVersion()
{
if (!defined('HHVM_VERSION_ID')) {
Expand Down
2 changes: 1 addition & 1 deletion tests/Composer/Test/Util/ProcessExecutorTest.php
Expand Up @@ -111,7 +111,7 @@ public function testConsoleIODoesNotFormatSymfonyConsoleStyle()
$output = new BufferedOutput(OutputInterface::VERBOSITY_NORMAL, true);
$process = new ProcessExecutor(new ConsoleIO(new ArrayInput(array()), $output, new HelperSet(array())));

$process->execute('php -r "echo \'<error>foo</error>\'.PHP_EOL;"');
$process->execute('php -ddisplay_errors=0 -derror_reporting=0 -r "echo \'<error>foo</error>\'.PHP_EOL;"');
$this->assertSame('<error>foo</error>'.PHP_EOL, $output->fetch());
}

Expand Down

0 comments on commit 10ae1d7

Please sign in to comment.