47
47
use const PHP_MAJOR_VERSION ;
48
48
use const PHP_MINOR_VERSION ;
49
49
use const PHP_VERSION ;
50
+ use const PHP_VERSION_ID ;
50
51
51
52
/** @group callmap */
52
53
class InternalCallMapHandlerTest extends TestCase
@@ -80,8 +81,8 @@ class InternalCallMapHandlerTest extends TestCase
80
81
'array_multisort ' ,
81
82
'datefmt_create ' => ['8.0 ' ],
82
83
'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 ' ],
85
86
'imagefilledpolygon ' ,
86
87
'imagegd ' ,
87
88
'imagegd2 ' ,
@@ -99,7 +100,7 @@ class InternalCallMapHandlerTest extends TestCase
99
100
'mailparse_msg_get_structure ' ,
100
101
'mailparse_msg_parse ' ,
101
102
'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 ' ],
103
104
'memcached::cas ' , // memcached 3.2.0 has incorrect reflection
104
105
'memcached::casbykey ' , // memcached 3.2.0 has incorrect reflection
105
106
'oauth::fetch ' ,
@@ -177,60 +178,60 @@ class InternalCallMapHandlerTest extends TestCase
177
178
* @var array<int|string, string|list<string>>
178
179
*/
179
180
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 ' ],
184
185
'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
188
189
'datetime::createfromimmutable ' => ['8.1 ' ],
189
190
'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
196
197
'datetimeimmutable::createfrominterface ' ,
197
198
'fiber::getcurrent ' ,
198
- 'filteriterator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
199
+ 'filteriterator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
199
200
'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 ' ],
213
214
'mysqli_stmt_get_warnings ' ,
214
215
'mysqli_stmt_insert_id ' ,
215
- 'norewinditerator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' ],
216
+ 'norewinditerator::getinneriterator ' => ['8.1 ' , '8.2 ' , '8.3 ' , ' 8.4 ' ],
216
217
'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 ' ],
221
222
'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 ' ],
227
228
'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 ' ],
230
231
'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 ' ],
234
235
];
235
236
236
237
/**
@@ -521,7 +522,11 @@ private function getReflectionFunction(string $functionName): ?ReflectionFunctio
521
522
{
522
523
try {
523
524
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 );
525
530
}
526
531
527
532
/** @var callable-string $functionName */
0 commit comments