| Conditions | 4 |
| Paths | 6 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 5.024 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 30 | 34 | public function __construct(array $elements = [], Matrix $matrix = null, $matrixOffset = null) |
|
| 31 | { |
||
| 32 | 34 | foreach ($elements as $offset => $element) { |
|
| 33 | 8 | $this->setElement($offset, $element); |
|
| 34 | 34 | } |
|
| 35 | |||
| 36 | 34 | if ($matrix) { |
|
| 37 | if (!$matrixOffset) { |
||
|
|
|||
| 38 | throw new \InvalidArgumentException('You must also supply a matrix offset when setting the matrix'); |
||
| 39 | } |
||
| 40 | |||
| 41 | $this->setMatrix($matrix, $matrixOffset); |
||
| 42 | } |
||
| 43 | 34 | } |
|
| 44 | |||
| 89 |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
integervalues, zero is a special case, in particular the following results might be unexpected: