@@ -36,6 +36,6 @@ |
||
| 36 | 36 | |
| 37 | 37 | public function getData() |
| 38 | 38 | { |
| 39 | - return $this->data; |
|
| 39 | + return $this->data; |
|
| 40 | 40 | } |
| 41 | 41 | } |
@@ -12,14 +12,14 @@ discard block |
||
| 12 | 12 | use Oliverde8\Component\PhpEtl\Loader\File\Csv; |
| 13 | 13 | use Oliverde8\Component\PhpEtl\Model\File\Csv\Writer; |
| 14 | 14 | |
| 15 | -$inputIterator = new Csv(__DIR__ . '/exemples/I-Service.csv'); |
|
| 15 | +$inputIterator = new Csv(__DIR__ . '/exemples/I-Service.csv'); |
|
| 16 | 16 | |
| 17 | 17 | $localizableAttributes = ['name_src', 'editor_name_src', 'valid_from', 'valid_to']; |
| 18 | 18 | |
| 19 | 19 | $operations = []; |
| 20 | 20 | |
| 21 | 21 | // Cleanup the data to use akeneo attribute codes. |
| 22 | -$operations[] = new CallbackTransformerOperation(function (DataItemInterface $item, &$context) { |
|
| 22 | +$operations[] = new CallbackTransformerOperation(function(DataItemInterface $item, &$context) { |
|
| 23 | 23 | $data = $item->getData(); |
| 24 | 24 | $newData = []; |
| 25 | 25 | $newData['sku'] = implode( |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | // Finalize transformation by having proper attribute codes taking locales into account. |
| 53 | 53 | $operations[] = new CallbackTransformerOperation( |
| 54 | - function (DataItemInterface $item, &$context) use ($localizableAttributes) { |
|
| 54 | + function(DataItemInterface $item, &$context) use ($localizableAttributes) { |
|
| 55 | 55 | |
| 56 | 56 | $data = []; |
| 57 | 57 | foreach ($item->getData() as $productDetails) { |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | $valueToCmp = $this->applyRules($rowData, $transformedData, $options['if'], $options); |
| 23 | 23 | $value = $this->applyRules($rowData, $transformedData, $options['value'], $options); |
| 24 | 24 | |
| 25 | - $result = $this->compare($valueToCmp, $value, $options['operation'])? $options['then'] : $options['else']; |
|
| 25 | + $result = $this->compare($valueToCmp, $value, $options['operation']) ? $options['then'] : $options['else']; |
|
| 26 | 26 | |
| 27 | 27 | return $this->applyRules($rowData, $transformedData, $result, $options); |
| 28 | 28 | } |
@@ -78,9 +78,9 @@ |
||
| 78 | 78 | public function constraintsAndResults() |
| 79 | 79 | { |
| 80 | 80 | return [ |
| 81 | - [['if' => 1, 'value' => 2, 'operation' => 'eq', ], 'false'], |
|
| 82 | - [['if' => 1, 'value' => 1, 'operation' => 'eq', ], 'true'], |
|
| 83 | - [['if' => 1, 'value' => 1, 'operation' => 'neq',], 'false'], |
|
| 81 | + [['if' => 1, 'value' => 2, 'operation' => 'eq', ], 'false'], |
|
| 82 | + [['if' => 1, 'value' => 1, 'operation' => 'eq', ], 'true'], |
|
| 83 | + [['if' => 1, 'value' => 1, 'operation' => 'neq', ], 'false'], |
|
| 84 | 84 | [['if' => 1, 'value' => [1, 2], 'operation' => 'in', ], 'true'], |
| 85 | 85 | [['if' => 3, 'value' => [1, 2], 'operation' => 'in', ], 'false'], |
| 86 | 86 | ]; |