Skip to content
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

Two new sniffs for Interfaces #144

Merged
merged 3 commits into from Aug 4, 2016

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Aug 4, 2016

1, Sniff to verify the use of interfaces against the PHP version in which they were introduced.
2. Sniff to verify that interfaces intended for PHP internal use are not being implemented in user land.

Sniff 1 also includes a check for unsupported methods, particularly that __sleep() and __wakeup() are not defined within a class implementing the Serializable interface as they would be ignored.

All checks unit tested.

I've copied over a method which was added to PHPCS for the upcoming 2.7 release. If at some point PHPCompatibility would up the minimum PHPCS version to 2.7+, this method can be removed.
This has also been documented in the method doc block.

This is a method which will be introduced in PHPCS 2.7, but as PHPCompatibility supports PHPCS from 1.5x-2.6.0 at the moment, has to be copied in to be used.
@wimg wimg merged commit aee42ae into PHPCompatibility:master Aug 4, 2016
@jrfnl jrfnl deleted the feature/new-interfaces-sniff branch August 4, 2016 20:32
@jrfnl jrfnl added this to the 7.0.3 milestone Apr 30, 2017
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.

None yet

2 participants