1.2.869. Null Type Favorite¶
Null typed may be written in two ways : with ? or with union type and null.
The analyzed code has less than 10% of one of them : for consistency reasons, it is recommended to make them all the same.
<?php
function foo(?A $a) : B|null {
// some code
}
?>
1.2.869.1. Connex PHP features¶
1.2.869.1.1. Specs¶
Short name |
Functions/NullTypeFavorite |
Rulesets |
|
Exakat since |
2.3.2 |
PHP Version |
With PHP 8.0 and more recent |
Severity |
Minor |
Time To Fix |
Quick (30 mins) |
Precision |
High |
Available in |