-
-
Notifications
You must be signed in to change notification settings - Fork 190
Use short nullable for PHP<8 since union types are not supported #1776
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
base: master
Are you sure you want to change the base?
Use short nullable for PHP<8 since union types are not supported #1776
Conversation
|
Quick question before I fix the test: the test fails on 7.4, however this test should not ever have passed on 7.4, since this test is a fatal error in PHP 7.4 Any plans to add a |
|
PHPCS is parser so it does not run code. PHPCS on PHP 7.4 can parse and fix code with PHP 8.4 syntax. |
|
No, you misunderstood me: PHPCS on PHP 7.4 with config php_version 80400 can fix code with PHP 8.4 syntax - but "php84 -l file.php" should pass without errors Therefore:
using PHP_VERSION_ID would be wrong, I'd need to check the php_version of phpcs config for that case and skip the test in that case. It seems there are no other tests that are version specific? Does this mean I can just remove the failing test, since it's only failing in PHP 7.4? |
SlevomatCodingStandard/Sniffs/TypeHints/DNFTypeHintFormatSniff.php
Outdated
Show resolved
Hide resolved
|
I don't usually test default values - only specific values of the options ( See other tests data for the lint check for specific PHP versions. |
3fddd0b to
edea4b9
Compare
7d8cbce to
5857454
Compare
|
Added tests, please merge |
Fix #1775