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

Improve support for arrow functions / sync with phpcs 3.5.5/6 #143

Merged

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Jun 5, 2020

Follow up on #77 and #79

This syncs in additional changes from PHPCS upstream as released in PHPCS 3.5.5 and to be released in PHPCS 3.5.6 in the handling and recognition of arrow functions.

Commit Summary

FunctionDeclarations::getArrowFunctionOpenClose(): arrow functions as function argument

Allow for arrow functions being used as function argument as per upstream commit 291401 which is included in PHPCS 3.5.5.

Also see: squizlabs/PHP_CodeSniffer#2895 and squizlabs/PHP_CodeSniffer#2523

BCFile::findEndOfStatement(): arrow functions as function argument

Allow for arrow functions being used as function argument as per upstream commit 291401 which is included in PHPCS 3.5.5.

Also see: squizlabs/PHP_CodeSniffer#2895 and squizlabs/PHP_CodeSniffer#2523

FunctionDeclarations::getArrowFunctionOpenClose(): allow for returning heredoc/nowdoc

... as per upstream commit ce62dee which will be included in PHPCS 3.5.6.

Also see: squizlabs/PHP_CodeSniffer#2926

As the PHPCS Tokenizer will hang completely when it encounters an arrow function with a heredoc/nowdoc return in PHPCS 3.5.3-3.5.5, this change needs a separate test file as these tests need to be skipped on those PHPCS versions.

jrfnl and others added 3 commits June 5, 2020 13:53
… function argument

Allow for arrow functions being used as function argument as per upstream commit squizlabs/PHP_CodeSniffer/commit/2914011675cd13f8a7d5eae16ed1d5ee4f0e701d which is included in PHPCS 3.5.5.

Also see: squizlabs/PHP_CodeSniffer 2895 and squizlabs/PHP_CodeSniffer 2523

Co-authored-by: Greg Sherwood <[email protected]>
Allow for arrow functions being used as function argument as per upstream commit squizlabs/PHP_CodeSniffer/commit/2914011675cd13f8a7d5eae16ed1d5ee4f0e701d which is included in PHPCS 3.5.5.

Also see: squizlabs/PHP_CodeSniffer 2895 and squizlabs/PHP_CodeSniffer 2523

Co-authored-by: Greg Sherwood <[email protected]>
…g heredoc/nowdoc

... as per upstream commit squizlabs/PHP_CodeSniffer/commit/ce62dee92da3b038a399a99353fc055b39d2853e which will be included in PHPCS 3.5.6.

Also see: squizlabs/PHP_CodeSniffer 2926

As the PHPCS Tokenizer will hang completely when it encounters an arrow function with a heredoc/nowdoc return in PHPCS 3.5.3-3.5.5, this change needs a separate test file as these tests need to be skipped on those PHPCS versions.

Co-authored-by: Greg Sherwood <[email protected]>
@jrfnl jrfnl added this to the 1.0.0-alpha3 milestone Jun 5, 2020
@jrfnl jrfnl merged commit b5b1c57 into develop Jun 5, 2020
@jrfnl jrfnl deleted the functiondeclarations/sync-arrow-functions-with-phpcs-356 branch June 5, 2020 12:26
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.

1 participant