Skip to content

Commit 1bcef70

Browse files
committed
Merge remote-tracking branch 'g/php84' into update_dictionaries
2 parents 9af1744 + 7c600dd commit 1bcef70

File tree

4 files changed

+56
-48
lines changed

4 files changed

+56
-48
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ jobs:
149149
uses: shivammathur/setup-php@v2
150150
with:
151151
php-version: "${{ matrix.php-version }}"
152-
ini-values: zend.assertions=1, assert.exception=1, opcache.enable_cli=1, opcache.jit=function, opcache.jit_buffer_size=512M
152+
ini-values: zend.assertions=1, assert.exception=1
153153
tools: composer:v2
154154
coverage: none
155155
extensions: none, curl, dom, filter, intl, json, libxml, mbstring, opcache, openssl, pcre, phar, reflection, simplexml, spl, tokenizer, xml, xmlwriter

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"composer/xdebug-handler": "^2.0 || ^3.0",
3131
"dnoegel/php-xdg-base-dir": "^0.1.1",
3232
"felixfbecker/advanced-json-rpc": "^3.1",
33-
"felixfbecker/language-server-protocol": "^1.5.2",
33+
"felixfbecker/language-server-protocol": "^1.5.3",
3434
"fidry/cpu-core-counter": "^0.4.1 || ^0.5.1 || ^1.0.0",
3535
"netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0",
3636
"nikic/php-parser": "^5.0.0",

psalm-baseline.xml

+3
Original file line numberDiff line numberDiff line change
@@ -2330,6 +2330,9 @@
23302330
</RiskyTruthyFalsyComparison>
23312331
</file>
23322332
<file src="tests/Internal/Codebase/InternalCallMapHandlerTest.php">
2333+
<MixedReturnStatement>
2334+
<code><![CDATA[ReflectionMethod::createFromMethodName($functionName)]]></code>
2335+
</MixedReturnStatement>
23332336
<RiskyTruthyFalsyComparison>
23342337
<code><![CDATA[empty($normalizedEntry['type'])]]></code>
23352338
</RiskyTruthyFalsyComparison>

tests/Internal/Codebase/InternalCallMapHandlerTest.php

+51-46
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
use const PHP_MAJOR_VERSION;
4848
use const PHP_MINOR_VERSION;
4949
use const PHP_VERSION;
50+
use const PHP_VERSION_ID;
5051

5152
/** @group callmap */
5253
class InternalCallMapHandlerTest extends TestCase
@@ -80,8 +81,8 @@ class InternalCallMapHandlerTest extends TestCase
8081
'array_multisort',
8182
'datefmt_create' => ['8.0'],
8283
'fiber::start',
83-
'get_class' => ['8.3'],
84-
'get_parent_class' => ['8.3'],
84+
'get_class' => ['8.3', '8.4'],
85+
'get_parent_class' => ['8.3', '8.4'],
8586
'imagefilledpolygon',
8687
'imagegd',
8788
'imagegd2',
@@ -99,7 +100,7 @@ class InternalCallMapHandlerTest extends TestCase
99100
'mailparse_msg_get_structure',
100101
'mailparse_msg_parse',
101102
'mailparse_stream_encode',
102-
'mb_check_encoding' => ['8.1', '8.2', '8.3'],
103+
'mb_check_encoding' => ['8.1', '8.2', '8.3', '8.4'],
103104
'memcached::cas', // memcached 3.2.0 has incorrect reflection
104105
'memcached::casbykey', // memcached 3.2.0 has incorrect reflection
105106
'oauth::fetch',
@@ -177,60 +178,60 @@ class InternalCallMapHandlerTest extends TestCase
177178
* @var array<int|string, string|list<string>>
178179
*/
179180
private static array $ignoredReturnTypeOnlyFunctions = [
180-
'appenditerator::getinneriterator' => ['8.1', '8.2', '8.3'],
181-
'appenditerator::getiteratorindex' => ['8.1', '8.2', '8.3'],
182-
'cachingiterator::getinneriterator' => ['8.1', '8.2', '8.3'],
183-
'callbackfilteriterator::getinneriterator' => ['8.1', '8.2', '8.3'],
181+
'appenditerator::getinneriterator' => ['8.1', '8.2', '8.3', '8.4'],
182+
'appenditerator::getiteratorindex' => ['8.1', '8.2', '8.3', '8.4'],
183+
'cachingiterator::getinneriterator' => ['8.1', '8.2', '8.3', '8.4'],
184+
'callbackfilteriterator::getinneriterator' => ['8.1', '8.2', '8.3', '8.4'],
184185
'curl_multi_getcontent',
185-
'datetime::add' => ['8.1', '8.2', '8.3'], // DateTime does not contain static
186-
'datetime::modify' => ['8.1', '8.2', '8.3'], // DateTime does not contain static
187-
'datetime::createfromformat' => ['8.1', '8.2', '8.3'], // DateTime does not contain static
186+
'datetime::add' => ['8.1', '8.2', '8.3', '8.4'], // DateTime does not contain static
187+
'datetime::modify' => ['8.1', '8.2', '8.3', '8.4'], // DateTime does not contain static
188+
'datetime::createfromformat' => ['8.1', '8.2', '8.3', '8.4'], // DateTime does not contain static
188189
'datetime::createfromimmutable' => ['8.1'],
189190
'datetime::createfrominterface',
190-
'datetime::setdate' => ['8.1', '8.2', '8.3'], // DateTime does not contain static
191-
'datetime::setisodate' => ['8.1', '8.2', '8.3'], // DateTime does not contain static
192-
'datetime::settime' => ['8.1', '8.2', '8.3'], // DateTime does not contain static
193-
'datetime::settimestamp' => ['8.1', '8.2', '8.3'], // DateTime does not contain static
194-
'datetime::settimezone' => ['8.1', '8.2', '8.3'], // DateTime does not contain static
195-
'datetime::sub' => ['8.1', '8.2', '8.3'], // DateTime does not contain static
191+
'datetime::setdate' => ['8.1', '8.2', '8.3', '8.4'], // DateTime does not contain static
192+
'datetime::setisodate' => ['8.1', '8.2', '8.3', '8.4'], // DateTime does not contain static
193+
'datetime::settime' => ['8.1', '8.2', '8.3', '8.4'], // DateTime does not contain static
194+
'datetime::settimestamp' => ['8.1', '8.2', '8.3', '8.4'], // DateTime does not contain static
195+
'datetime::settimezone' => ['8.1', '8.2', '8.3', '8.4'], // DateTime does not contain static
196+
'datetime::sub' => ['8.1', '8.2', '8.3', '8.4'], // DateTime does not contain static
196197
'datetimeimmutable::createfrominterface',
197198
'fiber::getcurrent',
198-
'filteriterator::getinneriterator' => ['8.1', '8.2', '8.3'],
199+
'filteriterator::getinneriterator' => ['8.1', '8.2', '8.3', '8.4'],
199200
'get_cfg_var', // Ignore array return type
200-
'infiniteiterator::getinneriterator' => ['8.1', '8.2', '8.3'],
201-
'iteratoriterator::getinneriterator' => ['8.1', '8.2', '8.3'],
202-
'limititerator::getinneriterator' => ['8.1', '8.2', '8.3'],
203-
'locale::getallvariants' => ['8.1', '8.2', '8.3'],
204-
'locale::getkeywords' => ['8.1', '8.2', '8.3'],
205-
'locale::getprimarylanguage' => ['8.1', '8.2', '8.3'],
206-
'locale::getregion' => ['8.1', '8.2', '8.3'],
207-
'locale::getscript' => ['8.1', '8.2', '8.3'],
208-
'locale::parselocale' => ['8.1', '8.2', '8.3'],
209-
'messageformatter::create' => ['8.1', '8.2', '8.3'],
210-
'multipleiterator::current' => ['8.1', '8.2', '8.3'],
211-
'mysqli::get_charset' => ['8.1', '8.2', '8.3'],
212-
'mysqli_stmt::get_warnings' => ['8.1', '8.2', '8.3'],
201+
'infiniteiterator::getinneriterator' => ['8.1', '8.2', '8.3', '8.4'],
202+
'iteratoriterator::getinneriterator' => ['8.1', '8.2', '8.3', '8.4'],
203+
'limititerator::getinneriterator' => ['8.1', '8.2', '8.3', '8.4'],
204+
'locale::getallvariants' => ['8.1', '8.2', '8.3', '8.4'],
205+
'locale::getkeywords' => ['8.1', '8.2', '8.3', '8.4'],
206+
'locale::getprimarylanguage' => ['8.1', '8.2', '8.3', '8.4'],
207+
'locale::getregion' => ['8.1', '8.2', '8.3', '8.4'],
208+
'locale::getscript' => ['8.1', '8.2', '8.3', '8.4'],
209+
'locale::parselocale' => ['8.1', '8.2', '8.3', '8.4'],
210+
'messageformatter::create' => ['8.1', '8.2', '8.3', '8.4'],
211+
'multipleiterator::current' => ['8.1', '8.2', '8.3', '8.4'],
212+
'mysqli::get_charset' => ['8.1', '8.2', '8.3', '8.4'],
213+
'mysqli_stmt::get_warnings' => ['8.1', '8.2', '8.3', '8.4'],
213214
'mysqli_stmt_get_warnings',
214215
'mysqli_stmt_insert_id',
215-
'norewinditerator::getinneriterator' => ['8.1', '8.2', '8.3'],
216+
'norewinditerator::getinneriterator' => ['8.1', '8.2', '8.3', '8.4'],
216217
'passthru',
217-
'recursivecachingiterator::getinneriterator' => ['8.1', '8.2', '8.3'],
218-
'recursivecallbackfilteriterator::getinneriterator' => ['8.1', '8.2', '8.3'],
219-
'recursivefilteriterator::getinneriterator' => ['8.1', '8.2', '8.3'],
220-
'recursiveregexiterator::getinneriterator' => ['8.1', '8.2', '8.3'],
218+
'recursivecachingiterator::getinneriterator' => ['8.1', '8.2', '8.3', '8.4'],
219+
'recursivecallbackfilteriterator::getinneriterator' => ['8.1', '8.2', '8.3', '8.4'],
220+
'recursivefilteriterator::getinneriterator' => ['8.1', '8.2', '8.3', '8.4'],
221+
'recursiveregexiterator::getinneriterator' => ['8.1', '8.2', '8.3', '8.4'],
221222
'reflectionclass::getstaticproperties' => ['8.1', '8.2'],
222-
'reflectionclass::newinstanceargs' => ['8.1', '8.2', '8.3'],
223-
'reflectionfunction::getclosurescopeclass' => ['8.1', '8.2', '8.3'],
224-
'reflectionfunction::getclosurethis' => ['8.1', '8.2', '8.3'],
225-
'reflectionmethod::getclosurescopeclass' => ['8.1', '8.2', '8.3'],
226-
'reflectionmethod::getclosurethis' => ['8.1', '8.2', '8.3'],
223+
'reflectionclass::newinstanceargs' => ['8.1', '8.2', '8.3', '8.4'],
224+
'reflectionfunction::getclosurescopeclass' => ['8.1', '8.2', '8.3', '8.4'],
225+
'reflectionfunction::getclosurethis' => ['8.1', '8.2', '8.3', '8.4'],
226+
'reflectionmethod::getclosurescopeclass' => ['8.1', '8.2', '8.3', '8.4'],
227+
'reflectionmethod::getclosurethis' => ['8.1', '8.2', '8.3', '8.4'],
227228
'reflectionobject::getstaticproperties' => ['8.1', '8.2'],
228-
'reflectionobject::newinstanceargs' => ['8.1', '8.2', '8.3'],
229-
'regexiterator::getinneriterator' => ['8.1', '8.2', '8.3'],
229+
'reflectionobject::newinstanceargs' => ['8.1', '8.2', '8.3', '8.4'],
230+
'regexiterator::getinneriterator' => ['8.1', '8.2', '8.3', '8.4'],
230231
'register_shutdown_function' => ['8.0', '8.1'],
231-
'splfileobject::fscanf' => ['8.1', '8.2', '8.3'],
232-
'spltempfileobject::fscanf' => ['8.1', '8.2', '8.3'],
233-
'xsltprocessor::transformtoxml' => ['8.1', '8.2', '8.3'],
232+
'splfileobject::fscanf' => ['8.1', '8.2', '8.3', '8.4'],
233+
'spltempfileobject::fscanf' => ['8.1', '8.2', '8.3', '8.4'],
234+
'xsltprocessor::transformtoxml' => ['8.1', '8.2', '8.3', '8.4'],
234235
];
235236

236237
/**
@@ -521,7 +522,11 @@ private function getReflectionFunction(string $functionName): ?ReflectionFunctio
521522
{
522523
try {
523524
if (strpos($functionName, '::') !== false) {
524-
return new ReflectionMethod($functionName);
525+
if (PHP_VERSION_ID < 8_03_00) {
526+
return new ReflectionMethod($functionName);
527+
}
528+
529+
return ReflectionMethod::createFromMethodName($functionName);
525530
}
526531

527532
/** @var callable-string $functionName */

0 commit comments

Comments
 (0)