@@ -28,14 +28,14 @@ discard block |
||
| 28 | 28 | protected function getRanges($selector) |
| 29 | 29 | { |
| 30 | 30 | return Factory::create(explode(';', $selector))->map( |
| 31 | - function ($range) { |
|
| 31 | + function($range) { |
|
| 32 | 32 | if ($separator = $this->dotDotSeparator($range) != false) { |
| 33 | - return Factory::create([substr($range, 0, $separator), substr($range, $separator + 2)]); |
|
| 33 | + return Factory::create([ substr($range, 0, $separator), substr($range, $separator + 2) ]); |
|
| 34 | 34 | } |
| 35 | 35 | if (($separator = $this->columnSeparator($range) != false) || |
| 36 | 36 | ($separator = $this->dashSeparator($range) != false) |
| 37 | 37 | ) { |
| 38 | - return Factory::create([substr($range, 0, $separator), substr($range, $separator + 1)]); |
|
| 38 | + return Factory::create([ substr($range, 0, $separator), substr($range, $separator + 1) ]); |
|
| 39 | 39 | } |
| 40 | 40 | if ($separator = $this->commaSeparator($range) != false) { |
| 41 | 41 | return Factory::create( |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | // just a number here |
| 50 | - return Factory::create([$range, $range]); |
|
| 50 | + return Factory::create([ $range, $range ]); |
|
| 51 | 51 | } |
| 52 | 52 | ); |
| 53 | 53 | } |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | public function supports(Collection $parameters) |
| 61 | 61 | { |
| 62 | 62 | return $parameters->assert( |
| 63 | - function ($param) { |
|
| 63 | + function($param) { |
|
| 64 | 64 | if (is_array($param) && count($param) == 2) { |
| 65 | 65 | return true; |
| 66 | 66 | } |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | { |
| 80 | 80 | $newCollection = Factory::create(); |
| 81 | 81 | $selector = $parameters->map( |
| 82 | - function ($param) { |
|
| 82 | + function($param) { |
|
| 83 | 83 | if ((is_array($param) && count($param) == 2)) { |
| 84 | 84 | return implode(':', $param); |
| 85 | 85 | } |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | )->implode(';'); |
| 90 | 90 | |
| 91 | 91 | return $this->getRanges($selector)->reduce( |
| 92 | - function (Collection $accumulator, Collection $range) use ($collection) { |
|
| 92 | + function(Collection $accumulator, Collection $range) use ($collection) { |
|
| 93 | 93 | $from = $range->first(); |
| 94 | 94 | $to = $range->last(); |
| 95 | 95 | if ($to >= $from) { |
@@ -21,13 +21,17 @@ |
||
| 21 | 21 | /** |
| 22 | 22 | * Explode the selector to get ranges. |
| 23 | 23 | * |
| 24 | - * @param $selector |
|
| 24 | + * @param string $selector |
|
| 25 | 25 | * |
| 26 | 26 | * @return Collection |
| 27 | 27 | */ |
| 28 | 28 | protected function getRanges($selector) |
| 29 | 29 | { |
| 30 | 30 | return Factory::create(explode(';', $selector))->map( |
| 31 | + |
|
| 32 | + /** |
|
| 33 | + * @param string $range |
|
| 34 | + */ |
|
| 31 | 35 | function ($range) { |
| 32 | 36 | if ($separator = $this->dotDotSeparator($range) != false) { |
| 33 | 37 | return Factory::create([substr($range, 0, $separator), substr($range, $separator + 2)]); |