You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe the issue is with MethodScanner and not ParameterScanner, as this is what is actually parsing the PHP tokens - it correctly ignores non-scalar type declarations such as array and callable. From what I can tell, string, int, bool and float are tokens of type T_STRING. As a result, the scanner believes they are classnames. This can result in classnames that simply don't exist.
I'm not really sure how this can be worked around inside the scanner. As far as I can tell, no PHP version checks are performed on the code being parsed, which means there's no reliable way of detecting whether or not string is an actual classname in PHP <7.0 code, or a scalar type declaration in PHP >=7.0 code.
Perhaps there needs to be some way to globally set the PHP version of the code being scanned?
I believe the issue is with
MethodScannerand notParameterScanner, as this is what is actually parsing the PHP tokens - it correctly ignores non-scalar type declarations such asarrayandcallable. From what I can tell,string,int,boolandfloatare tokens of typeT_STRING. As a result, the scanner believes they are classnames. This can result in classnames that simply don't exist.I'm not really sure how this can be worked around inside the scanner. As far as I can tell, no PHP version checks are performed on the code being parsed, which means there's no reliable way of detecting whether or not
stringis an actual classname in PHP <7.0 code, or a scalar type declaration in PHP >=7.0 code.Perhaps there needs to be some way to globally set the PHP version of the code being scanned?