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

Account for upstream changes related to PHP 7.4 arrow functions #3

Closed
jrfnl opened this issue Nov 7, 2019 · 1 comment · Fixed by #77
Closed

Account for upstream changes related to PHP 7.4 arrow functions #3

jrfnl opened this issue Nov 7, 2019 · 1 comment · Fixed by #77

Comments

@jrfnl
Copy link
Member

jrfnl commented Nov 7, 2019

See upstream issue: squizlabs/PHP_CodeSniffer#2523

Relevant commits which need to be emulated & made backward compatible (in as far possible):

The upstream changes are expected to be released in PHPCS 3.5.3.

Upstream will probably also contain a $functionKeyword token array (not yet implemented).

@jrfnl jrfnl added this to the 1.0.0 milestone Nov 7, 2019
@jrfnl
Copy link
Member Author

jrfnl commented Nov 8, 2019

Other related to do's:

  • Adjust Parentheses::getOwner() to allow for T_FN as parentheses owner in older PHPCS versions.
  • Array::getDoubleArrowPtr(): Take the double arrow in arrow functions into account when searching for array double arrows.
  • Take arrow functions into account anywhere and everywhere code is in place to skip (over) closed scopes.

For most of these: can't just check for T_FN, will also need to check for T_STRING with fn content and parentheses opener as next effective token.

Similar, can't just check T_FN_ARROW, but will also need to check for T_DOUBLE_ARROW preceded by parentheses, preceded by T_FN/T_STRING with content fn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant