Conditions | 3 |
Paths | 3 |
Total Lines | 7 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
28 | public function validateType($item) { |
||
29 | $itemClass = $this->objectsClassName(); |
||
30 | if (($item instanceof $itemClass) == false) { |
||
|
|||
31 | $className = ($item === null) ? null : get_class($item); |
||
32 | throw new \Exception('Invalid object type. Expect ' . $this->objectsClassName() . ' given ' . $className); |
||
33 | } |
||
34 | } |
||
35 | |||
37 |
When comparing two booleans, it is generally considered safer to use the strict comparison operator.