| Total Complexity | 4 |
| Total Lines | 19 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | trait IdnDependencyTrait |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var bool|null A separate property is used for easier testing. |
||
| 13 | */ |
||
| 14 | private ?bool $idnFunctionExists = null; |
||
| 15 | |||
| 16 | 123 | private function initIdnFunctionExists(): void |
|
| 17 | { |
||
| 18 | 123 | $this->idnFunctionExists = function_exists('idn_to_ascii'); |
|
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @throws RuntimeException |
||
| 23 | */ |
||
| 24 | 126 | private function idnFunctionRequired(): void |
|
| 28 | } |
||
| 29 | } |
||
| 31 |
If an expression can have both
false, andnullas possible values. It is generally a good practice to always use strict comparison to clearly distinguish between those two values.