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

Add new sniff to detect Late Static Binding. #177

Merged
merged 1 commit into from Aug 17, 2016

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Aug 17, 2016

Late static binding is only available on PHP 5.3 +.
Ref: http://php.net/manual/en/language.oop5.late-static-bindings.php

This sniff throws two new errors:

  1. For LSB detected inside class/interface/trait scope and PHP < 5.3.
  2. For LSB detected outside of class/interface/trait scope (not supported).

Includes unit tests.

Late static binding is only available on PHP 5.3 +.
Ref: http://php.net/manual/en/language.oop5.late-static-bindings.php

This sniff throws two new errors:
1. For LSB detected inside class/interface/trait scope and PHP < 5.3.
2. For LSB detected outside of class/interface/trait scope (not supported).

Includes unit tests.
@wimg wimg merged commit c6e70e3 into PHPCompatibility:master Aug 17, 2016
@jrfnl jrfnl deleted the feature/late-static-binding branch August 18, 2016 03:53
@MarkMaldaba
Copy link
Contributor

This is awesome! I had always assumed that this was the one new language feature that would be impossible to test for! :-)

@jrfnl
Copy link
Member Author

jrfnl commented Aug 18, 2016

Turned out not to be that difficult, but I might be overlooking something. Please let me know if I've missed any typical situations which should be checked for (see the test cases in the unit tests).

@MarkMaldaba
Copy link
Contributor

MarkMaldaba commented Sep 13, 2016

I'll log a ticket if I come across anything.

@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

3 participants