Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | 1 | public function assign(array $externalData) |
|
11 | { |
||
12 | 1 | $priceCollection = new \Iris\Transfer\Catalog\ConfigCollection; |
|
13 | 1 | foreach ($externalData as $data) { |
|
14 | 1 | $price = new \Iris\Transfer\Catalog\Config([ |
|
|
|||
15 | 1 | 'sku' => $data['sku'], |
|
16 | 1 | 'price' => $data['price'], |
|
17 | 1 | 'special_price' => $data['special_price'], |
|
18 | 1 | 'specialFromDate' => $data['special_from_date'], |
|
19 | 1 | 'specialToDate' => $data['special_to_date'] |
|
20 | 1 | ]); |
|
21 | 1 | } |
|
22 | |||
23 | 1 | return $priceCollection; |
|
24 | } |
||
25 | |||
46 |
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.