-
Notifications
You must be signed in to change notification settings - Fork 439
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
define: case_insensitive is ignored, case-insensitive constants are no longer supported #589
define: case_insensitive is ignored, case-insensitive constants are no longer supported #589
Conversation
tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php
Outdated
Show resolved
Hide resolved
efd31ce
to
0471f87
Compare
4c26321
to
41e48b4
Compare
I've made a new rule which checks if argument 3 is provided on PHP 8. |
@ondrejmirtes thanks for the feedback! I'll pick this up next week during my allotted phpstan dev time |
case_insensitive is ignored, case-insensitive constants are no longer supported
0e8e597
to
2085a64
Compare
public function supportsCaseInsensitiveConstantNames(): bool | ||
{ | ||
return $this->versionId < 80000; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ondrejmirtes this handles PHP 8 not supporting it at all. What about handling the fact it was deprecated in 7.3
Per https://www.php.net/manual/en/function.define.php,
Defining case-insensitive constants is deprecated as of PHP 7.3.0.
Should we add another method that checks the PHP version ID if they're deprecated so we can report that error in our rule? Or just not supported and that's it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reporting something on 7.3 and below 8.0 is somewhat a different scenario that's a better fit for https://github.com/phpstan/phpstan-deprecation-rules.
2085a64
to
99cacf6
Compare
99cacf6
to
4dbefe4
Compare
Thank you! |
case_insensitive is ignored, case-insensitive constants are no longer supported
phpstan/phpstan#5368