| Conditions | 3 |
| Paths | 2 |
| Total Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 3.0416 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | 3 | public function __construct(\SplFileObject $file, $xpath = null) |
|
| 21 | { |
||
| 22 | 3 | $this->filename = $file->getPathname(); |
|
| 23 | |||
| 24 | 3 | if (!is_null($xpath) && !is_string($xpath)) { |
|
| 25 | throw new \InvalidArgumentException('xpath must be null or a string'); |
||
| 26 | } |
||
| 27 | |||
| 28 | 3 | $this->xpath = $xpath; |
|
| 29 | 3 | } |
|
| 30 | |||
| 103 |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
stringvalues, the empty string''is a special case, in particular the following results might be unexpected: