Skip to content

ValidFunctionName: Add additional unit test for interfaces extending multiple interfaces #1562

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

Merged
merged 1 commit into from
Dec 19, 2018

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Dec 19, 2018

Interfaces can extend multiple other interfaces. Looking at the sniff code, no changes are needed in the sniff to account for this, however, adding an additional unit test to warrant against sniff changes in the future which may not take this into account.

N.B.: I've verified all other usages of the T_INTERFACE token in the whole of WPCS and this was the only one which looked at extends/implements, so the only one for which interfaces extending multiple other interfaces could be problematic.

See:

Loosely related to:

Fixes #1459 (which is effectively the same PR)

…multiple interfaces

Interfaces can extend multiple other interfaces. Looking at the sniff code, no changes are needed in the sniff to account for this, however, adding an additional unit test to warrant against sniff changes in the future which may not take this into account.

N.B.: I've verified all other usages of the `T_INTERFACE` token in the whole of WPCS and this was the only one which looked at `extends/implements`, so the only one for which interfaces extending multiple other interfaces could be problematic.

See:
* http://php.net/manual/en/language.oop5.interfaces.php#example-208

Loosely related to:
* squizlabs/PHP_CodeSniffer#2128
@jrfnl jrfnl force-pushed the feature/valid-functionname-extra-unittest branch from e2e0a80 to d22aca8 Compare December 19, 2018 14:25
@GaryJones GaryJones merged commit 1c18912 into develop Dec 19, 2018
@GaryJones GaryJones deleted the feature/valid-functionname-extra-unittest branch December 19, 2018 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants