Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
36 | 3 | private function getAllowedNames() : array |
|
37 | { |
||
38 | // Add any SANS that might be on the certificate. |
||
39 | 3 | $allowedNames = $this->certificate->sans(); |
|
40 | |||
41 | 3 | $sslCertSubject = $this->certificate->subject(); |
|
42 | |||
43 | // Add the common name from the certificate. |
||
44 | 3 | if (isset($sslCertSubject['CN'])) { |
|
45 | 3 | $allowedNames[] = $sslCertSubject['CN']; |
|
46 | } |
||
47 | |||
48 | 3 | return $allowedNames; |
|
49 | } |
||
50 | |||
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: