Completed
Pull Request — master (#38)
by Radosław
01:58
created
src/macros/math/subtract.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('subtract', function ($a, $b) {
6
+P::macro('subtract', function($a, $b) {
7 7
     return $a - $b;
8 8
 });
Please login to merge, or discard this patch.
src/macros/math/add.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('add', function ($a, $b) {
6
+P::macro('add', function($a, $b) {
7 7
     return $a + $b;
8 8
 });
Please login to merge, or discard this patch.
src/macros/math/mean.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('mean', function (array $numbers) {
6
+P::macro('mean', function(array $numbers) {
7 7
     return array_sum($numbers) / count($numbers);
8 8
 });
Please login to merge, or discard this patch.
src/macros/math/median.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@
 block discarded – undo
3 3
 
4 4
 use Baethon\Phln\Phln as P;
5 5
 
6
-P::macro('median', function (array $numbers) {
6
+P::macro('median', function(array $numbers) {
7 7
     sort($numbers, SORT_NUMERIC);
8 8
     $middle = count($numbers) / 2;
9 9
     $even = (0 === $middle % 2);
10 10
 
11
-    $offsets = $even ? [$middle - 1, 2] : [(int)floor($middle), 1];
11
+    $offsets = $even ? [$middle - 1, 2] : [(int) floor($middle), 1];
12 12
     $slice = array_slice($numbers, ...$offsets);
13 13
 
14 14
     return P::mean($slice);
Please login to merge, or discard this patch.
src/macros/math/divide.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('divide', function ($a, $b) {
6
+P::macro('divide', function($a, $b) {
7 7
     return $a / $b;
8 8
 });
Please login to merge, or discard this patch.
src/macros/type/typeCond.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,10 +3,10 @@
 block discarded – undo
3 3
 
4 4
 use Baethon\Phln\Phln as P;
5 5
 
6
-P::macro('typeCond', function (array $pairs): \Closure {
6
+P::macro('typeCond', function(array $pairs): \Closure {
7 7
     $typeToPredicate = P::ifElse('\\is_callable', P::ref('identity'), P::is());
8 8
 
9
-    $mapRow = function ($row) use ($typeToPredicate) {
9
+    $mapRow = function($row) use ($typeToPredicate) {
10 10
         $p = $typeToPredicate($row[0]);
11 11
         return [$p, $row[1]];
12 12
     };
Please login to merge, or discard this patch.
src/macros/type/is.php 2 patches
Switch Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -8,23 +8,23 @@
 block discarded – undo
8 8
     $expectedType = strtolower($type);
9 9
 
10 10
     switch ($expectedType) {
11
-    case 'object':
12
-        return 'object' === $typeOfValue;
11
+        case 'object':
12
+            return 'object' === $typeOfValue;
13 13
 
14
-    case 'bool':
15
-    case 'boolean':
16
-        return 'boolean' === $typeOfValue;
14
+        case 'bool':
15
+        case 'boolean':
16
+            return 'boolean' === $typeOfValue;
17 17
 
18
-    case 'double':
19
-    case 'float':
20
-        return 'double' === $typeOfValue;
18
+        case 'double':
19
+        case 'float':
20
+            return 'double' === $typeOfValue;
21 21
 
22
-    case 'callable':
23
-    case 'function':
24
-        return is_callable($value);
22
+        case 'callable':
23
+        case 'function':
24
+            return is_callable($value);
25 25
 
26
-    default:
27
-        return (is_object($value) && $value instanceof $type) ||
28
-            $typeOfValue === $expectedType;
26
+        default:
27
+            return (is_object($value) && $value instanceof $type) ||
28
+                $typeOfValue === $expectedType;
29 29
     }
30 30
 });
Please login to merge, or discard this 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('is', function (string $type, $value): bool {
6
+P::macro('is', function(string $type, $value): bool {
7 7
     $typeOfValue = strtolower(gettype($value));
8 8
     $expectedType = strtolower($type);
9 9
 
Please login to merge, or discard this patch.
src/macros/object/props.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,13 +4,13 @@
 block discarded – undo
4 4
 use Baethon\Phln\Phln as P;
5 5
 use function Baethon\Phln\assertObject;
6 6
 
7
-P::macro('props', function (array $props, $object): array {
7
+P::macro('props', function(array $props, $object): array {
8 8
     assertObject($object);
9 9
 
10 10
     $getProp = P::partial(P::ref('prop'), [P::__, $object]);
11 11
 
12 12
     return P::reduce(
13
-        function ($carry, $prop) use ($getProp) {
13
+        function($carry, $prop) use ($getProp) {
14 14
             return P::append($getProp($prop), $carry);
15 15
         },
16 16
         [],
Please login to merge, or discard this patch.
src/macros/object/merge.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 use Baethon\Phln\Phln as P;
5 5
 use function Baethon\Phln\assertObject;
6 6
 
7
-P::macro('merge', function ($left, $right): array
7
+P::macro('merge', function($left, $right): array
8 8
 {
9 9
     assertObject($left);
10 10
     assertObject($right);
Please login to merge, or discard this patch.