Completed
Branch master (a31674)
by Radosław
02:21
created
src/macros/collection/partition.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,11 +3,11 @@
 block discarded – undo
3 3
 
4 4
 use Baethon\Phln\Phln as P;
5 5
 
6
-P::macro('partition', function (callable $predicate, array $collection): array {
6
+P::macro('partition', function(callable $predicate, array $collection): array {
7 7
     return P::apply(
8 8
         P::pipe([
9 9
             P::reduce(
10
-                function ($carry, $item) use ($predicate) {
10
+                function($carry, $item) use ($predicate) {
11 11
                     $key = $predicate($item)
12 12
                         ? 'left'
13 13
                         : 'right';
Please login to merge, or discard this patch.
src/macros/collection/groupBy.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,9 +3,9 @@
 block discarded – undo
3 3
 
4 4
 use Baethon\Phln\Phln as P;
5 5
 
6
-P::macro('groupBy', function (callable $fn, array $collection): array {
6
+P::macro('groupBy', function(callable $fn, array $collection): array {
7 7
     return P::reduce(
8
-        function ($carry, $item) use ($fn) {
8
+        function($carry, $item) use ($fn) {
9 9
             $key = $fn($item);
10 10
             $innerList = array_key_exists($key, $carry)
11 11
                 ? $carry[$key]
Please login to merge, or discard this patch.
src/macros/collection/unique.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 
4 4
 use Baethon\Phln\Phln as P;
5 5
 
6
-P::macro('unique', function (array $list): array {
7
-    $reducer = function ($carry, $item) {
6
+P::macro('unique', function(array $list): array {
7
+    $reducer = function($carry, $item) {
8 8
         return in_array($item, $carry, true) ? $carry : P::append($item, $carry);
9 9
     };
10 10
 
Please login to merge, or discard this patch.
src/macros/collection/sortBy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 
4 4
 use Baethon\Phln\Phln as P;
5 5
 
6
-P::macro('sortBy', function (callable $mapper, array $list): array {
6
+P::macro('sortBy', function(callable $mapper, array $list): array {
7 7
     $column = array_map($mapper, $list);
8 8
     array_multisort($column, \SORT_REGULAR, $list);
9 9
 
Please login to merge, or discard this patch.
src/macros/collection/tail.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,6 +3,6 @@
 block discarded – undo
3 3
 
4 4
 use Baethon\Phln\Phln as P;
5 5
 
6
-P::macro('tail', function ($collection) {
6
+P::macro('tail', function($collection) {
7 7
     return P::slice(1, P::length($collection), $collection);
8 8
 });
Please login to merge, or discard this patch.
src/macros/collection/append.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 
4 4
 use Baethon\Phln\Phln as P;
5 5
 
6
-P::macro('append', function ($value, $collection) {
7
-    $pushToArray = function (array $copy) use ($value) {
6
+P::macro('append', function($value, $collection) {
7
+    $pushToArray = function(array $copy) use ($value) {
8 8
         array_push($copy, $value);
9 9
         return $copy;
10 10
     };
Please login to merge, or discard this patch.
src/macros/collection/filter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,6 +3,6 @@
 block discarded – undo
3 3
 
4 4
 use Baethon\Phln\Phln as P;
5 5
 
6
-P::macro('filter', function (callable $predicate, array $list): array {
6
+P::macro('filter', function(callable $predicate, array $list): array {
7 7
     return array_values(array_filter($list, $predicate));
8 8
 });
Please login to merge, or discard this patch.
src/macros/collection/length.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 
4 4
 use Baethon\Phln\Phln as P;
5 5
 
6
-P::macro('length', function ($collection): int {
6
+P::macro('length', function($collection): int {
7 7
     return P::apply(
8 8
         P::cond([
9 9
             ['\\is_countable', '\\count'],
Please login to merge, or discard this patch.
src/macros/collection/contains.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 
4 4
 use Baethon\Phln\Phln as P;
5 5
 
6
-P::macro('contains', function ($value, $collection): bool {
6
+P::macro('contains', function($value, $collection): bool {
7 7
     $stringContains = P::partialRight('\\strstr', [$value]);
8 8
 
9 9
     return P::apply(
Please login to merge, or discard this patch.