Skip to content

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

Merged
jrfnl merged 3 commits into
developfrom
functiondeclarations/sync-arrow-functions-with-phpcs-356
Jun 5, 2020
Merged

Improve support for arrow functions / sync with phpcs 3.5.5/6#143
jrfnl merged 3 commits into
developfrom
functiondeclarations/sync-arrow-functions-with-phpcs-356

Conversation

@jrfnl

@jrfnl jrfnl commented Jun 5, 2020

Copy link
Copy Markdown
Member

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 <gsherwood@squiz.net>
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 <gsherwood@squiz.net>
…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 <gsherwood@squiz.net>
@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

Development

Successfully merging this pull request may close these issues.

1 participant