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

PHP 8.0 | Backfill the new T_NULLSAFE_OBJECT_OPERATOR token #3040

Closed
15 tasks done
jrfnl opened this issue Aug 1, 2020 · 4 comments
Closed
15 tasks done

PHP 8.0 | Backfill the new T_NULLSAFE_OBJECT_OPERATOR token #3040

jrfnl opened this issue Aug 1, 2020 · 4 comments
Milestone

Comments

@jrfnl
Copy link
Contributor

jrfnl commented Aug 1, 2020

PHP 8 introduces a new object chaining operator ?-> which short-circuits moving to the next expression if the left-hand side evaluates to null.

Refs:

Impact for PHP_CodeSniffer

In addition to that, various sniffs will need to be adjusted to take the new token into account.

Initial inventory of affected sniffs:

I have commits ready for all sniffs with a checkmark and will pull those once the initial tokenizer changes have been merged.

Not claiming completeness, there may be more sniffs which need changes, but this should take care of the bulk of it.

@jrfnl
Copy link
Contributor Author

jrfnl commented Sep 1, 2020

All the commits I had ready & waiting for this have now been pulled.

@gsherwood
Copy link
Member

That was an amazing set of PRs adding so much support. Thank you very much. I've still got a couple more to review but will get to those soon.

@gsherwood
Copy link
Member

Going to close this now as all linked PRs have been merged. If anything else needs doing, it can be handled as new a PR.

Thanks again for the massive effort getting this in.

@jrfnl
Copy link
Contributor Author

jrfnl commented Sep 9, 2020

@gsherwood Actually, #3089 also still belongs with this series, even though it's more a "clean up" than "add support" type PR, but yes, all the "add support" type PRs have now been merged for this issue.

wmfgerrit pushed a commit to wikimedia/mediawiki-tools-codesniffer that referenced this issue Oct 26, 2020
squizlabs/PHP_CodeSniffer#3040

From changelog:
The PHP 8.0 T_NULLSAFE_OBJECT_OPERATOR token has been made available for
older versions
Existing sniffs that check for T_OBJECT_OPERATOR have been modified to
apply the same rules for the nullsafe object operator

Change-Id: Ie59f2a0de1ca96d2d7372cd279b2fd60a9329305
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants