PHP: Support for matching types in function parameters #4589
Labels
alpha
Relates to an experimental feature
feature:matching
lang:php
priority:low
user:external
requested by someone outside of r2c
Right now it's not possible to match types defined in function parameters. This makes it impossible to match functions or methods that are defined with type information.
Example here: https://semgrep.dev/s/idawson-gl:findmethod
It would be excellent if we were able to match on types, or use ellipsis to ignore them.
The only way to currently match a function like the one above is to have a rule that matches the variable name, which.. is not ideal.
Interestingly, this is also an issue for classes that extend other classes (again seems to be a type propagation issue). The difference is I can actually get it to match (again using metavariable-regex):
The text was updated successfully, but these errors were encountered: