-
Notifications
You must be signed in to change notification settings - Fork 9
Description
I think that happens because it's defined here:
https://github.com/phpstan/phpstan-src/blob/1f150cc9ae1fcab992aca658f317b91d0757107f/resources/functionMap.php#L2640
I don't know if functionMap allows specifying that such an argument should be considered actual bitflags.
Using another function as an example (ftp_set_option) doesn't report an issue because the argument type is specified as an int:
https://github.com/phpstan/phpstan-src/blob/1f150cc9ae1fcab992aca658f317b91d0757107f/resources/functionMap.php#L3043
Demo: https://phpstan.org/r/1356266d-ef73-43ea-a7d9-ea0cb95c1075
As far I understand it, phpstan also uses the phpstorm-stubs, and it has correct arguments specified for both using ExpectedValues(flags)
attribute, if phpstan supports this attribute then maybe such functions just need to be removed from the functionMap? But a quick search in the codebase shows no matches for ExpectedValues
,
https://github.com/JetBrains/phpstorm-stubs/blob/6c034ae018ed7ac2cacf2474f824aede73658afa/standard/standard_8.php#L850-L863
https://github.com/JetBrains/phpstorm-stubs/blob/6c034ae018ed7ac2cacf2474f824aede73658afa/ftp/ftp.php#L511