-
-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
False positive when reusing an internal interface name in userspace #1649
Comments
@pfrenssen This is a known issue which will be fixed once namespace and use statement tracking and resolution is available in PHPCSUtils. |
I wrote an pull request before i found this issue. Linking it for your convenience #1695 |
rdss-sknott
added a commit
to rdss-sknott/PHPCompatibility
that referenced
this issue
Apr 8, 2024
…ue (PHPCompatibility#1649) * Make InternalInterfacesSniff namespace sensitive * Make NewInterfaceSniff namespace sensitive
rdss-sknott
added a commit
to rdss-sknott/PHPCompatibility
that referenced
this issue
Apr 22, 2024
rdss-sknott
added a commit
to rdss-sknott/PHPCompatibility
that referenced
this issue
Apr 22, 2024
rdss-sknott
added a commit
to rdss-sknott/PHPCompatibility
that referenced
this issue
Apr 22, 2024
rdss-sknott
added a commit
to rdss-sknott/PHPCompatibility
that referenced
this issue
Apr 22, 2024
…ue (PHPCompatibility#1649) * Make InternalInterfacesSniff namespace sensitive * Make NewInterfaceSniff namespace sensitive
Fixed via #1700 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug description
The
InternalInterfacesSniff
is intended to detect when classes are extending or implementing internal PHP interfaces. For example the following is illegal and should throw an error:However when a custom interface is created in a namespace that happens to have the same name as an internal interface, then this shouldn't throw an error. This should be allowed:
Discovered in the wild in Drupal code: https://git.drupalcode.org/project/drupal/-/blob/11.x/core/lib/Drupal/Core/TypedData/Plugin/DataType/DateTimeIso8601.php?ref_type=heads
Given the following reproduction scenario
Scan the following code:
Result:
Tested Against
develop
branch?develop
branch of PHPCompatibility.The text was updated successfully, but these errors were encountered: