Use short nullable for PHP<8 since union types are not supported#1776
Use short nullable for PHP<8 since union types are not supported#1776kkmuffme wants to merge 5 commits intoslevomat:masterfrom
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. |
7d8cbce to
5857454
Compare
|
Added tests, please merge |
5857454 to
bc95f3c
Compare
Fix #1775