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.1 support #3479
Comments
Proposal: For intersection types, I'd like to propose to re-tokenize to a new PHPCS native This is in-line with the changes made for PHP 8.0 union types (see #3032 and #3302). Note: the Also note that the |
For all
|
Addition to the list:
e.g.
At the moment, this tokenises to |
For the purpose of writing sniffs, I think it is completely unnecessary to retokenize that. Use as a first class callable is straightforward to detect (is the next non-empty token a close parenthesis ?). Retokenizing to a PHPCS native token constant is generally only done when it would need a lot of logic within a sniff to determine whether the token is the target token, or when not retokenizing would lead to lots of false positives in pre-existing sniffs. Neither applies. |
To add to the list:
|
I was about to report the same as #557 enum being detected as GOTO: enum Suit: string {
case Hearts = 'H';
case Diamonds = 'D';
case Clubs = 'C';
case Spades = 'S';
}
|
@nunoperalta There is already a PR open to fix that: #3534 |
@jrfnl nice one! Any idea when it will be merged? I see it's been there for 15 days. Thank you very much. |
@nunoperalta When the maintainers have time to review. |
@gsherwood @jrfnl @kukulich loving and using Enums in all of my current projects is it possible at all to just get #3482 merged and release that? |
- it was hard to look up the payment status through the payment specific fields - enable easier lookup This commit can be reverted when doing squizlabs/PHP_CodeSniffer#3479
- it was hard to look up the payment status through the payment specific fields - enable easier lookup This commit can be reverted when doing squizlabs/PHP_CodeSniffer#3479
Everything is solved now in |
Thank you!! When will the release be made? |
- it was hard to look up the payment status through the payment specific fields - enable easier lookup This commit can be reverted when doing squizlabs/PHP_CodeSniffer#3479
Issue to track what needs to be done:
enum
keyword PHP 8.1: Added support forenum
keyword #3478enum
support to sniffs PHP 8.1: Addedenum
support to sniffs #3482T_ENUM_CASE
PHP 8.1: AddedT_ENUM_CASE
#3483readonly
keyword PHP 8.1: Added support forreadonly
keyword #3480never
buildin type PHP 8.1: Support ofnever
type #3582T_TYPE_INTERSECTION
and updateFile::getMethodParameters()
,File::getMethodProperties()
andFile::getMemberProperties()
PHP 8.1: Support of intersection types #3581final
#3527. A cursory review of existing sniffs showed no other obvious sniffs which would need adujsting.The text was updated successfully, but these errors were encountered: