Skip to content

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

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

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Aug 22, 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:

…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
Copy link
Member Author

jrfnl commented Aug 22, 2018

Oh cricky... turns out support for interfaces was only added to the PHPCS File::findExtendedClassName() method in PHPCS 3.1.0.

Considering that we'll be dropping PHPCS 2.x support in the near future and there have been no bug reports, I don't think it's worth adding a fix to the sniff to make this work with PHPCS 2.x.

So, I'm going to go ahead and change the milestone to 2.0.0. Once work on that release has started and the PHPCS minimum supported version has been raised, the PR can be rebased and the build should then pass without problem.

@jrfnl jrfnl added Status: Requirement not met On hold until WPCS supports a particular version of a dependency (PHP, PHP_CodeSniffer, etc.). and removed Status: Review ready labels Aug 22, 2018
@jrfnl jrfnl modified the milestones: 1.1.0, 2.0.0 Aug 22, 2018
@jrfnl
Copy link
Member Author

jrfnl commented Dec 19, 2018

I've rebased this PR now that the "drop PHPCS 2.x" PR has been merged. I expect the build to pass now, so this PR is ready for review.

@jrfnl jrfnl added Status: Review ready and removed Status: Requirement not met On hold until WPCS supports a particular version of a dependency (PHP, PHP_CodeSniffer, etc.). labels Dec 19, 2018
@jrfnl jrfnl closed this Dec 19, 2018
@jrfnl jrfnl deleted the feature/valid-functionname-extra-unittest branch December 19, 2018 13:13
@jrfnl
Copy link
Member Author

jrfnl commented Dec 19, 2018

Oops.. I seem to have pulled this from my own fork, so updating the PR got a bit screwed up. Never mind. This PR is now replaced by #1562

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.

1 participant