@@ -37,7 +37,7 @@ public function __construct() {
37
37
$ this ->supportedFunctions = [
38
38
// function type to remove original return type
39
39
// -------------------------------------------------------------------------
40
- 'curl_init ' => $ bool , // resource|CurlHandle|false (2) @see https://www.php.net/manual/en/function.curl-init.php
40
+ 'curl_init ' => $ bool , // resource|CurlHandle|false @see https://www.php.net/manual/en/function.curl-init.php
41
41
'file ' => $ bool , // array|false
42
42
'file_get_contents ' => $ bool , // string|false @see https://www.php.net/manual/en/function.file-get-contents.php
43
43
'filemtime ' => $ bool , // int|false @see https://www.php.net/manual/en/function.filemtime.php
@@ -57,7 +57,7 @@ public function __construct() {
57
57
'stream_get_contents ' => $ bool , // string|false @see https://www.php.net/manual/en/function.stream-get-contents.php
58
58
59
59
// (1) either PHPStan or the PHP documentation is wrong
60
- // (2) with PHPStan v1.11.10 the extension is not called
60
+ // (2) the extension is not called by PHPStan
61
61
];
62
62
}
63
63
@@ -104,8 +104,9 @@ protected function getOriginalTypeFromFunctionCall(FunctionReflection $function,
104
104
public function getTypeFromFunctionCall (FunctionReflection $ function , FuncCall $ functionCall , Scope $ scope ): Type {
105
105
$ name = $ function ->getName ();
106
106
107
- if (in_array ($ name , ['curl_init ' , 'preg_replace ' ])) {
108
- throw new ExtensionException ("function $ name was passed to " .simpleClassName (__CLASS__ ).' extension ' );
107
+ if (in_array ($ name , ['preg_replace ' ])) {
108
+ // throw an exception to get notified when PHPStan bugs get fixed
109
+ throw new ExtensionException ("pewa: PHPStan bugfix -> core function $ name is now passed to the " .simpleClassName (__CLASS__ ).' extension ' );
109
110
}
110
111
111
112
$ origType = $ this ->getOriginalTypeFromFunctionCall ($ function , $ functionCall , $ scope );
0 commit comments