Merged
Conversation
33a3e6a to
144b078
Compare
This sniff only covers a small part of the changes in the PHP 7.0 Uniform Variable Syntax RFC, but it's at least another part which is covered. > ```php > // support nested :: > $foo['bar']::$baz > $foo::$bar::$baz > $foo->bar()::baz() > ``` > > Static property fetches and method calls can now be applied to any dereferencable expression. E.g. `$foo['bar']::$baz`, `$foo::$bar::$baz` and `$foo->bar()::baz()` are all valid now. Ref: https://wiki.php.net/rfc/uniform_variable_syntax The sniff implementation as is being pulled now is supported by various tests run on 3v4l: https://3v4l.org/up9e3 https://3v4l.org/7tZcL https://3v4l.org/5uuFR https://3v4l.org/grUNF https://3v4l.org/mtWn9 https://3v4l.org/PAtnX https://3v4l.org/qujtp https://3v4l.org/Rrteo https://3v4l.org/GQA2P https://3v4l.org/2XCUZ https://3v4l.org/d3vcp Includes unit tests. The sniff has been run over a number of large PHP projects to see if any false positives could be found, but didn't find any. Fixes 946
144b078 to
7e137ab
Compare
wimg
approved these changes
Mar 26, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This sniff only covers a small part of the changes in the PHP 7.0 Uniform Variable Syntax RFC, but it's at least another part which is covered.
Ref: https://wiki.php.net/rfc/uniform_variable_syntax
The sniff implementation as is being pulled now is supported by various tests run on 3v4l:
https://3v4l.org/up9e3
https://3v4l.org/7tZcL
https://3v4l.org/5uuFR
https://3v4l.org/grUNF
https://3v4l.org/mtWn9
https://3v4l.org/PAtnX
https://3v4l.org/qujtp
https://3v4l.org/Rrteo
https://3v4l.org/GQA2P
https://3v4l.org/2XCUZ
https://3v4l.org/d3vcp
Includes unit tests.
The sniff has been run over a number of large PHP projects to see if any false positives could be found, but didn't find any, though I'm not giving out any guarantees at this point.
Fixes #946