Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
75 | 6 | public static function createFromArray(array $values) |
|
76 | { |
||
77 | 3 | $class = static::class; |
|
78 | |||
79 | /* @var AbstractVector $vector */ |
||
80 | 3 | $vector = new $class(); |
|
81 | |||
82 | 3 | foreach ($values as $offset => $value) { |
|
83 | 3 | $vector->setElement($offset, new Element($value)); |
|
84 | 3 | } |
|
85 | |||
86 | 6 | return $vector; |
|
87 | } |
||
88 | } |
||
89 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
integer
values, zero is a special case, in particular the following results might be unexpected: