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

Allow for classes which *extend* potentially newly introduced classes. #140

Merged
merged 1 commit into from Aug 3, 2016

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Aug 3, 2016

The NewClasses sniff checks for instantiation of classes new DateTime;, but did not check for classes extending other classes, i.e. class MyOwnDateTime extends DateTime {}.

This PR fixes that. Includes unit tests.

As JsonSerializable is an interface and not a class, this is not tested with the extends syntax. In reality, JsonSerializable should probably be moved to a NewInterfaces sniff.

The `NewClasses` sniff check for instantiation of classes `new DateTime;`, but did not check for classes extending other classes, i.e. `class MyOwnDateTime extends DateTime {}`.

This PR fixes that. Includes unit tests.

As `JsonSerializable` is an interface and not a class, this is not tested with the `extends` syntax. In reality, `JsonSerializable` should probably be moved to a `NewInterfaces` sniff.
@wimg wimg merged commit a0c8a1f into PHPCompatibility:master Aug 3, 2016
@jrfnl jrfnl deleted the feature/new-classes-extended branch August 4, 2016 05:56
@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