Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
51 | 3 | private function getNameVariations($domain) : array |
|
52 | { |
||
53 | 3 | $nameVariations = [$domain]; |
|
54 | |||
55 | // If we're looking at a subdomain then check for wildcards. |
||
56 | 3 | if (substr_count($domain, '.') >= 2) { |
|
57 | 3 | $nameVariations[] = '*' . substr($domain, strpos($domain, '.')); |
|
58 | } |
||
59 | |||
60 | 3 | return $nameVariations; |
|
61 | } |
||
62 | } |
||
63 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: