@@ -12,7 +12,7 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function pipe($options = []) |
| 14 | 14 | { |
| 15 | - return function ($inputData) use ($options) { |
|
| 15 | + return function($inputData) use ($options) { |
|
| 16 | 16 | return Arr::get($inputData, Arr::get($options, 'key')); |
| 17 | 17 | }; |
| 18 | 18 | } |
@@ -33,8 +33,8 @@ |
||
| 33 | 33 | $header = array_shift($data); |
| 34 | 34 | |
| 35 | 35 | if ($this->config['useHeaderAsIndex']) { |
| 36 | - $data = collect($data)->map(function ($row) use ($header) { |
|
| 37 | - return collect($row)->mapWithKeys(function ($column, $index) use ($header) { |
|
| 36 | + $data = collect($data)->map(function($row) use ($header) { |
|
| 37 | + return collect($row)->mapWithKeys(function($column, $index) use ($header) { |
|
| 38 | 38 | return [$header[$index] => $column]; |
| 39 | 39 | }); |
| 40 | 40 | })->toArray(); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function toArray() |
| 15 | 15 | { |
| 16 | - return collect($this->getData())->map(function ($itemData) { |
|
| 16 | + return collect($this->getData())->map(function($itemData) { |
|
| 17 | 17 | return (new Item($itemData, $this->transformers))->toArray(); |
| 18 | 18 | })->toArray(); |
| 19 | 19 | } |
@@ -95,7 +95,7 @@ |
||
| 95 | 95 | */ |
| 96 | 96 | public function pipe($options = []) |
| 97 | 97 | { |
| 98 | - return function ($inputData) use ($options) { |
|
| 98 | + return function($inputData) use ($options) { |
|
| 99 | 99 | $this->setData($inputData); |
| 100 | 100 | |
| 101 | 101 | return $this->toArray(); |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | public function pipe($options = []) |
| 68 | 68 | { |
| 69 | - return function ($inputData) use ($options) { |
|
| 69 | + return function($inputData) use ($options) { |
|
| 70 | 70 | $true = Arr::get($options, 'true', new Pipeline()); |
| 71 | 71 | $true = $true instanceof \Closure ? $true() : $true; |
| 72 | 72 | $false = Arr::get($options, 'false', new Pipeline()); |
@@ -75,11 +75,11 @@ discard block |
||
| 75 | 75 | $this->setData($inputData); |
| 76 | 76 | |
| 77 | 77 | return $this->matchAndRun( |
| 78 | - function () use ($true, $inputData) { |
|
| 78 | + function() use ($true, $inputData) { |
|
| 79 | 79 | /* @var Pipeline $true */ |
| 80 | 80 | return $true->flow($inputData); |
| 81 | 81 | }, |
| 82 | - function () use ($false, $inputData) { |
|
| 82 | + function() use ($false, $inputData) { |
|
| 83 | 83 | /* @var Pipeline $false */ |
| 84 | 84 | return $false->flow($inputData); |
| 85 | 85 | } |
@@ -190,7 +190,7 @@ |
||
| 190 | 190 | */ |
| 191 | 191 | public function pipe($options = []) |
| 192 | 192 | { |
| 193 | - return function ($inputData) use ($options) { |
|
| 193 | + return function($inputData) use ($options) { |
|
| 194 | 194 | if (!is_null($inputData)) { |
| 195 | 195 | $this->setData($inputData); |
| 196 | 196 | } |
@@ -11,9 +11,9 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | public function transform($data) |
| 13 | 13 | { |
| 14 | - return collect($data)->reject(function ($value, $key) { |
|
| 14 | + return collect($data)->reject(function($value, $key) { |
|
| 15 | 15 | return in_array($key, $this->config['properties']); |
| 16 | - })->map(function ($value) { |
|
| 16 | + })->map(function($value) { |
|
| 17 | 17 | return !is_array($value) ? $value : $this->transform($value); |
| 18 | 18 | })->toArray(); |
| 19 | 19 | } |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | */ |
| 23 | 23 | public function transform($data) |
| 24 | 24 | { |
| 25 | - return collect($data)->mapWithKeys(function ($value, $key) { |
|
| 25 | + return collect($data)->mapWithKeys(function($value, $key) { |
|
| 26 | 26 | if (!count($this->config['properties']) || (count($this->config['properties']) && in_array($key, $this->config['properties']))) { |
| 27 | 27 | return [preg_replace($this->config['pattern'], $this->config['replacement'], $key) => !is_array($value) ? $value : $this->transform($value)]; |
| 28 | 28 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | public function transform($data) |
| 23 | 23 | { |
| 24 | - return collect($data)->mapWithKeys(function ($value, $key) { |
|
| 24 | + return collect($data)->mapWithKeys(function($value, $key) { |
|
| 25 | 25 | return [str_replace('-', $this->config['separator'], str_slug($key)) => !is_array($value) ? $value : $this->transform($value)]; |
| 26 | 26 | })->toArray(); |
| 27 | 27 | } |