Conditions | 2 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | 1 | public function assign(array $externalData) |
|
11 | { |
||
12 | 1 | $imageCollection = new \Iris\Transfer\Catalog\ImageCollection; |
|
13 | |||
14 | 1 | foreach ($externalData['items'] as $data) { |
|
15 | 1 | $imageCollection[] = new \Iris\Transfer\Catalog\Image([ |
|
16 | 1 | 'url' => $data['url'], |
|
17 | 1 | 'position' => $data['position'], |
|
18 | 1 | 'processStatus' => $data['process_status'] |
|
19 | 1 | ]); |
|
20 | 1 | } |
|
21 | |||
22 | 1 | $configCollection = new \Iris\Transfer\Catalog\Config([ |
|
|
|||
23 | 1 | 'sku' => $externalData['sku'], |
|
24 | 'imageCollection' => $imageCollection |
||
25 | 1 | ]); |
|
26 | |||
27 | 1 | 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
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.