| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | public function assign(array $externalData) |
||
| 11 | { |
||
| 12 | $imageCollection = new \Iris\Transfer\Catalog\ImageCollection; |
||
| 13 | |||
| 14 | foreach ($externalData as $data) { |
||
| 15 | $imageCollection[] = new \Iris\Transfer\Catalog\Image([ |
||
| 16 | 'url' => $data['url'], |
||
| 17 | 'position' => $data['position'], |
||
| 18 | 'processStatus' => $data['process_status'] |
||
| 19 | ]); |
||
| 20 | } |
||
| 21 | |||
| 22 | $configCollection = new \Iris\Transfer\Catalog\Config([ |
||
|
|
|||
| 23 | 'sku' => $externalData['sku'], |
||
| 24 | 'imageCollection' => $imageCollection |
||
| 25 | ]); |
||
| 26 | |||
| 27 | return $imageCollection; |
||
| 28 | } |
||
| 29 | |||
| 47 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVarassignment in line 1 and the$higherassignment in line 2 are dead. The first because$myVaris never used and the second because$higheris always overwritten for every possible time line.