diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d1103373cb..811051df702 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -129,6 +129,7 @@ jobs: - "8.1" - "8.2" - "8.3" + - "8.4" count: ${{ fromJson(needs.chunk-matrix.outputs.count) }} chunk: ${{ fromJson(needs.chunk-matrix.outputs.chunks) }} diff --git a/composer.json b/composer.json index aed943f1dd5..602928094c4 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ } ], "require": { - "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0", + "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0", "ext-SimpleXML": "*", "ext-ctype": "*", "ext-dom": "*", @@ -30,7 +30,7 @@ "composer/xdebug-handler": "^2.0 || ^3.0", "dnoegel/php-xdg-base-dir": "^0.1.1", "felixfbecker/advanced-json-rpc": "^3.1", - "felixfbecker/language-server-protocol": "^1.5.2", + "felixfbecker/language-server-protocol": "^1.5.3", "fidry/cpu-core-counter": "^0.4.1 || ^0.5.1 || ^1.0.0", "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", "nikic/php-parser": "^4.17", @@ -47,7 +47,7 @@ }, "require-dev": { "ext-curl": "*", - "amphp/phpunit-util": "^2.0", + "amphp/phpunit-util": "^2.0.1", "bamarni/composer-bin-plugin": "^1.4", "brianium/paratest": "^6.9", "mockery/mockery": "^1.5", diff --git a/tests/Internal/Codebase/InternalCallMapHandlerTest.php b/tests/Internal/Codebase/InternalCallMapHandlerTest.php index e5f6320fba5..e852bf5d9bc 100644 --- a/tests/Internal/Codebase/InternalCallMapHandlerTest.php +++ b/tests/Internal/Codebase/InternalCallMapHandlerTest.php @@ -45,6 +45,7 @@ use const PHP_MAJOR_VERSION; use const PHP_MINOR_VERSION; use const PHP_VERSION; +use const PHP_VERSION_ID; /** @group callmap */ class InternalCallMapHandlerTest extends TestCase @@ -78,8 +79,8 @@ class InternalCallMapHandlerTest extends TestCase 'array_multisort', 'datefmt_create' => ['8.0'], 'fiber::start', - 'get_class' => ['8.3'], - 'get_parent_class' => ['8.3'], + 'get_class' => ['8.3', '8.4'], + 'get_parent_class' => ['8.3', '8.4'], 'imagefilledpolygon', 'imagegd', 'imagegd2', @@ -97,7 +98,7 @@ class InternalCallMapHandlerTest extends TestCase 'mailparse_msg_get_structure', 'mailparse_msg_parse', 'mailparse_stream_encode', - 'mb_check_encoding' => ['8.1', '8.2', '8.3'], + 'mb_check_encoding' => ['8.1', '8.2', '8.3', '8.4'], 'memcached::cas', // memcached 3.2.0 has incorrect reflection 'memcached::casbykey', // memcached 3.2.0 has incorrect reflection 'oauth::fetch', @@ -175,60 +176,60 @@ class InternalCallMapHandlerTest extends TestCase * @var array> */ private static array $ignoredReturnTypeOnlyFunctions = [ - 'appenditerator::getinneriterator' => ['8.1', '8.2', '8.3'], - 'appenditerator::getiteratorindex' => ['8.1', '8.2', '8.3'], - 'cachingiterator::getinneriterator' => ['8.1', '8.2', '8.3'], - 'callbackfilteriterator::getinneriterator' => ['8.1', '8.2', '8.3'], + 'appenditerator::getinneriterator' => ['8.1', '8.2', '8.3', '8.4'], + 'appenditerator::getiteratorindex' => ['8.1', '8.2', '8.3', '8.4'], + 'cachingiterator::getinneriterator' => ['8.1', '8.2', '8.3', '8.4'], + 'callbackfilteriterator::getinneriterator' => ['8.1', '8.2', '8.3', '8.4'], 'curl_multi_getcontent', - 'datetime::add' => ['8.1', '8.2', '8.3'], // DateTime does not contain static - 'datetime::modify' => ['8.1', '8.2', '8.3'], // DateTime does not contain static - 'datetime::createfromformat' => ['8.1', '8.2', '8.3'], // DateTime does not contain static + 'datetime::add' => ['8.1', '8.2', '8.3', '8.4'], // DateTime does not contain static + 'datetime::modify' => ['8.1', '8.2', '8.3', '8.4'], // DateTime does not contain static + 'datetime::createfromformat' => ['8.1', '8.2', '8.3', '8.4'], // DateTime does not contain static 'datetime::createfromimmutable' => ['8.1'], 'datetime::createfrominterface', - 'datetime::setdate' => ['8.1', '8.2', '8.3'], // DateTime does not contain static - 'datetime::setisodate' => ['8.1', '8.2', '8.3'], // DateTime does not contain static - 'datetime::settime' => ['8.1', '8.2', '8.3'], // DateTime does not contain static - 'datetime::settimestamp' => ['8.1', '8.2', '8.3'], // DateTime does not contain static - 'datetime::settimezone' => ['8.1', '8.2', '8.3'], // DateTime does not contain static - 'datetime::sub' => ['8.1', '8.2', '8.3'], // DateTime does not contain static + 'datetime::setdate' => ['8.1', '8.2', '8.3', '8.4'], // DateTime does not contain static + 'datetime::setisodate' => ['8.1', '8.2', '8.3', '8.4'], // DateTime does not contain static + 'datetime::settime' => ['8.1', '8.2', '8.3', '8.4'], // DateTime does not contain static + 'datetime::settimestamp' => ['8.1', '8.2', '8.3', '8.4'], // DateTime does not contain static + 'datetime::settimezone' => ['8.1', '8.2', '8.3', '8.4'], // DateTime does not contain static + 'datetime::sub' => ['8.1', '8.2', '8.3', '8.4'], // DateTime does not contain static 'datetimeimmutable::createfrominterface', 'fiber::getcurrent', - 'filteriterator::getinneriterator' => ['8.1', '8.2', '8.3'], + 'filteriterator::getinneriterator' => ['8.1', '8.2', '8.3', '8.4'], 'get_cfg_var', // Ignore array return type - 'infiniteiterator::getinneriterator' => ['8.1', '8.2', '8.3'], - 'iteratoriterator::getinneriterator' => ['8.1', '8.2', '8.3'], - 'limititerator::getinneriterator' => ['8.1', '8.2', '8.3'], - 'locale::getallvariants' => ['8.1', '8.2', '8.3'], - 'locale::getkeywords' => ['8.1', '8.2', '8.3'], - 'locale::getprimarylanguage' => ['8.1', '8.2', '8.3'], - 'locale::getregion' => ['8.1', '8.2', '8.3'], - 'locale::getscript' => ['8.1', '8.2', '8.3'], - 'locale::parselocale' => ['8.1', '8.2', '8.3'], - 'messageformatter::create' => ['8.1', '8.2', '8.3'], - 'multipleiterator::current' => ['8.1', '8.2', '8.3'], - 'mysqli::get_charset' => ['8.1', '8.2', '8.3'], - 'mysqli_stmt::get_warnings' => ['8.1', '8.2', '8.3'], + 'infiniteiterator::getinneriterator' => ['8.1', '8.2', '8.3', '8.4'], + 'iteratoriterator::getinneriterator' => ['8.1', '8.2', '8.3', '8.4'], + 'limititerator::getinneriterator' => ['8.1', '8.2', '8.3', '8.4'], + 'locale::getallvariants' => ['8.1', '8.2', '8.3', '8.4'], + 'locale::getkeywords' => ['8.1', '8.2', '8.3', '8.4'], + 'locale::getprimarylanguage' => ['8.1', '8.2', '8.3', '8.4'], + 'locale::getregion' => ['8.1', '8.2', '8.3', '8.4'], + 'locale::getscript' => ['8.1', '8.2', '8.3', '8.4'], + 'locale::parselocale' => ['8.1', '8.2', '8.3', '8.4'], + 'messageformatter::create' => ['8.1', '8.2', '8.3', '8.4'], + 'multipleiterator::current' => ['8.1', '8.2', '8.3', '8.4'], + 'mysqli::get_charset' => ['8.1', '8.2', '8.3', '8.4'], + 'mysqli_stmt::get_warnings' => ['8.1', '8.2', '8.3', '8.4'], 'mysqli_stmt_get_warnings', 'mysqli_stmt_insert_id', - 'norewinditerator::getinneriterator' => ['8.1', '8.2', '8.3'], + 'norewinditerator::getinneriterator' => ['8.1', '8.2', '8.3', '8.4'], 'passthru', - 'recursivecachingiterator::getinneriterator' => ['8.1', '8.2', '8.3'], - 'recursivecallbackfilteriterator::getinneriterator' => ['8.1', '8.2', '8.3'], - 'recursivefilteriterator::getinneriterator' => ['8.1', '8.2', '8.3'], - 'recursiveregexiterator::getinneriterator' => ['8.1', '8.2', '8.3'], + 'recursivecachingiterator::getinneriterator' => ['8.1', '8.2', '8.3', '8.4'], + 'recursivecallbackfilteriterator::getinneriterator' => ['8.1', '8.2', '8.3', '8.4'], + 'recursivefilteriterator::getinneriterator' => ['8.1', '8.2', '8.3', '8.4'], + 'recursiveregexiterator::getinneriterator' => ['8.1', '8.2', '8.3', '8.4'], 'reflectionclass::getstaticproperties' => ['8.1', '8.2'], - 'reflectionclass::newinstanceargs' => ['8.1', '8.2', '8.3'], - 'reflectionfunction::getclosurescopeclass' => ['8.1', '8.2', '8.3'], - 'reflectionfunction::getclosurethis' => ['8.1', '8.2', '8.3'], - 'reflectionmethod::getclosurescopeclass' => ['8.1', '8.2', '8.3'], - 'reflectionmethod::getclosurethis' => ['8.1', '8.2', '8.3'], + 'reflectionclass::newinstanceargs' => ['8.1', '8.2', '8.3', '8.4'], + 'reflectionfunction::getclosurescopeclass' => ['8.1', '8.2', '8.3', '8.4'], + 'reflectionfunction::getclosurethis' => ['8.1', '8.2', '8.3', '8.4'], + 'reflectionmethod::getclosurescopeclass' => ['8.1', '8.2', '8.3', '8.4'], + 'reflectionmethod::getclosurethis' => ['8.1', '8.2', '8.3', '8.4'], 'reflectionobject::getstaticproperties' => ['8.1', '8.2'], - 'reflectionobject::newinstanceargs' => ['8.1', '8.2', '8.3'], - 'regexiterator::getinneriterator' => ['8.1', '8.2', '8.3'], + 'reflectionobject::newinstanceargs' => ['8.1', '8.2', '8.3', '8.4'], + 'regexiterator::getinneriterator' => ['8.1', '8.2', '8.3', '8.4'], 'register_shutdown_function' => ['8.0', '8.1'], - 'splfileobject::fscanf' => ['8.1', '8.2', '8.3'], - 'spltempfileobject::fscanf' => ['8.1', '8.2', '8.3'], - 'xsltprocessor::transformtoxml' => ['8.1', '8.2', '8.3'], + 'splfileobject::fscanf' => ['8.1', '8.2', '8.3', '8.4'], + 'spltempfileobject::fscanf' => ['8.1', '8.2', '8.3', '8.4'], + 'xsltprocessor::transformtoxml' => ['8.1', '8.2', '8.3', '8.4'], ]; /** @@ -519,7 +520,12 @@ private function getReflectionFunction(string $functionName): ?ReflectionFunctio { try { if (strpos($functionName, '::') !== false) { - return new ReflectionMethod($functionName); + if (PHP_VERSION_ID < 8_03_00) { + [$className, , $methodName] = explode(':', $functionName, 3); + return new ReflectionMethod($className, $methodName); + } + + return ReflectionMethod::createFromMethodName($functionName); } /** @var callable-string $functionName */