@@ -13,7 +13,7 @@ |
||
13 | 13 | |
14 | 14 | function identity() |
15 | 15 | { |
16 | - return function ($value) { |
|
16 | + return function($value) { |
|
17 | 17 | return $value; |
18 | 18 | }; |
19 | 19 | } |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Created by IntelliJ IDEA. |
|
4 | - * User: alemaire |
|
5 | - * Date: 06/07/2015 |
|
6 | - * Time: 11:04 |
|
7 | - */ |
|
3 | + * Created by IntelliJ IDEA. |
|
4 | + * User: alemaire |
|
5 | + * Date: 06/07/2015 |
|
6 | + * Time: 11:04 |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | namespace Fp\Collection; |
10 | 10 | use Fp; |
@@ -31,14 +31,14 @@ discard block |
||
31 | 31 | public function filter(callable $callback) |
32 | 32 | { |
33 | 33 | return new Self( |
34 | - Fp\filter($callback, $this->values()) |
|
34 | + Fp\filter($callback, $this->values()) |
|
35 | 35 | ); |
36 | 36 | } |
37 | 37 | |
38 | 38 | public function transduce(callable $transducers, Fp\Reducer\Reducer $reducer, $init = null) |
39 | 39 | { |
40 | 40 | return new Self( |
41 | - Fp\transduce($transducers, $reducer, $this->values(), $init) |
|
41 | + Fp\transduce($transducers, $reducer, $this->values(), $init) |
|
42 | 42 | ); |
43 | 43 | } |
44 | 44 |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | function mapping(callable $callback) |
25 | 25 | { |
26 | - $mapping_transducer = function (Reducer $reducer) use ($callback) { |
|
26 | + $mapping_transducer = function(Reducer $reducer) use ($callback) { |
|
27 | 27 | return new Mapping($reducer, $callback); |
28 | 28 | }; |
29 | 29 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | function filtering(callable $callback) |
34 | 34 | { |
35 | - $filtering_transducer = function (Reducer $reducer) use ($callback) { |
|
35 | + $filtering_transducer = function(Reducer $reducer) use ($callback) { |
|
36 | 36 | return new Filtering($reducer, $callback); |
37 | 37 | }; |
38 | 38 | |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | function enumerating($start = 0) |
43 | 43 | { |
44 | - $enumerating_transducer = function (Reducer $reducer) use ($start) { |
|
44 | + $enumerating_transducer = function(Reducer $reducer) use ($start) { |
|
45 | 45 | return new Enumerating($reducer, $start); |
46 | 46 | }; |
47 | 47 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | function batching($batch_size) |
52 | 52 | { |
53 | - $batching_transducer = function (Reducer $reducer) use ($batch_size) { |
|
53 | + $batching_transducer = function(Reducer $reducer) use ($batch_size) { |
|
54 | 54 | return new Batching($reducer, $batch_size); |
55 | 55 | }; |
56 | 56 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | function first(callable $callback) |
61 | 61 | { |
62 | - $first_transducer = function (Reducer $reducer) use ($callback) { |
|
62 | + $first_transducer = function(Reducer $reducer) use ($callback) { |
|
63 | 63 | return new First($reducer, $callback); |
64 | 64 | }; |
65 | 65 |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | */ |
16 | 16 | function map(callable $callback, $iterable = null) |
17 | 17 | { |
18 | - if ($iterable === null){ |
|
18 | + if ($iterable === null) { |
|
19 | 19 | return mapping($callback); |
20 | 20 | } elseif ($iterable instanceof Collection) { |
21 | 21 | return $iterable->map($callback); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | */ |
36 | 36 | function filter(callable $callback, $iterable = null) |
37 | 37 | { |
38 | - if($iterable === null) { |
|
38 | + if ($iterable === null) { |
|
39 | 39 | return filtering($callback); |
40 | 40 | } elseif ($iterable instanceof Collection) { |
41 | 41 | return $iterable->filter($callback); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | function tail($array) |
59 | 59 | { |
60 | - if($array instanceof Collection) { |
|
60 | + if ($array instanceof Collection) { |
|
61 | 61 | return $array->tail(); |
62 | 62 | } |
63 | 63 | return array_slice($array, 1); |
@@ -19,12 +19,12 @@ |
||
19 | 19 | function compose() |
20 | 20 | { |
21 | 21 | $functions_list = array_reverse(func_get_args()); |
22 | - $composed = function () use ($functions_list) { |
|
22 | + $composed = function() use ($functions_list) { |
|
23 | 23 | $first_function = array_shift($functions_list); |
24 | 24 | |
25 | 25 | return array_reduce( |
26 | 26 | $functions_list, |
27 | - function ($carry, $item) { |
|
27 | + function($carry, $item) { |
|
28 | 28 | return $item($carry); |
29 | 29 | }, |
30 | 30 | call_user_func_array($first_function, func_get_args()) |