Conditions | 6 |
Paths | 20 |
Total Lines | 16 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 6.2163 |
1 | <?php |
||
23 | 4 | protected function indexRow($offset, $row) |
|
24 | { |
||
25 | 4 | if ($row instanceof ShippingMethod) { |
|
26 | $name = $row->getName(); |
||
27 | $id = $row->getId(); |
||
28 | } else { |
||
29 | 4 | $name = isset($row[static::NAME]) ? $row[static::NAME] : null; |
|
30 | 4 | $id = isset($row[static::ID]) ? $row[static::ID] : null; |
|
31 | } |
||
32 | 4 | if (!empty($name)) { |
|
33 | 1 | $this->addToIndex(static::NAME, $offset, $name); |
|
34 | } |
||
35 | 4 | if (!empty($id)) { |
|
36 | 1 | $this->addToIndex(static::ID, $offset, $id); |
|
37 | } |
||
38 | 4 | } |
|
39 | |||
49 |