1
0
Fork 0

Fix some PHP 8.1 deprecation warnings, fixes #10008

pull/10016/head
Jordi Boggiano 2021-07-21 14:02:30 +02:00
parent f5a03b950d
commit 10ae1d7b08
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
4 changed files with 3 additions and 12 deletions

View File

@ -79,6 +79,7 @@ class Pool implements \Countable
/**
* Returns how many packages have been loaded into the pool
*/
#[\ReturnTypeWillChange]
public function count()
{
return \count($this->packages);

View File

@ -283,6 +283,7 @@ class ArrayRepository implements RepositoryInterface
*
* @return int Number of packages
*/
#[\ReturnTypeWillChange]
public function count()
{
if (null === $this->packages) {

View File

@ -68,17 +68,6 @@ class HhvmDetectorTest extends TestCase
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')) {

View File

@ -111,7 +111,7 @@ class ProcessExecutorTest extends TestCase
$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());
}