ValidFunctionName: Add additional unit test for interfaces extending multiple interfaces#1459
Conversation
…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
|
Oh cricky... turns out support for interfaces was only added to the PHPCS 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 |
|
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. |
|
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 |
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_INTERFACEtoken in the whole of WPCS and this was the only one which looked atextends/implements, so the only one for which interfaces extending multiple other interfaces could be problematic.See:
Loosely related to:
File::findExtendedInterfaceNames()utility method squizlabs/PHP_CodeSniffer#2128