Completed
Push — master ( 713d54...d55531 )
by Amine
02:08
created
src/list.php 3 patches
Doc Comments   -70 removed lines patch added patch discarded remove patch
@@ -11,8 +11,6 @@  discard block
 block discarded – undo
11 11
  * ```
12 12
  *
13 13
  * @signature (a -> b) -> [a] -> [b]
14
- * @param  callable $fn
15
- * @param  array $list
16 14
  * @return array
17 15
  */
18 16
 function map() {
@@ -31,8 +29,6 @@  discard block
 block discarded – undo
31 29
  * ```
32 30
  *
33 31
  * @signature (a -> [b]) -> [a] -> [b]
34
- * @param  callable $fn
35
- * @param  array $list
36 32
  * @return array
37 33
  */
38 34
 function chain() {
@@ -51,8 +47,6 @@  discard block
 block discarded – undo
51 47
  * $numeric($list) // [1, 3]
52 48
  * ```
53 49
  * @signature (a -> Boolean) -> [a] -> [a]
54
- * @param  callable $fn
55
- * @param  array $list
56 50
  * @return array
57 51
  */
58 52
 function filter() {
@@ -72,9 +66,6 @@  discard block
 block discarded – undo
72 66
  * ```
73 67
  *
74 68
  * @signature (* -> a -> *) -> * -> [a] -> *
75
- * @param  callable $fn
76
- * @param  mixed $initial
77
- * @param  array $list
78 69
  * @return array
79 70
  */
80 71
 function reduce() {
@@ -99,8 +90,6 @@  discard block
 block discarded – undo
99 90
  * ```
100 91
  *
101 92
  * @signature (a -> *) -> [a] -> [a]
102
- * @param  callable $fn
103
- * @param  array $list
104 93
  * @return array
105 94
  */
106 95
 function each() {
@@ -252,8 +241,6 @@  discard block
 block discarded – undo
252 241
  * ```
253 242
  *
254 243
  * @signature (a -> Boolean) -> [a] -> Boolean
255
- * @param  callable $predicate
256
- * @param  array $list
257 244
  * @return bool
258 245
  */
259 246
 function all() {
@@ -273,8 +260,6 @@  discard block
 block discarded – undo
273 260
  * ```
274 261
  *
275 262
  * @signature (a -> Boolean) -> [a] -> Boolean
276
- * @param  callable $predicate
277
- * @param  array $list
278 263
  * @return bool
279 264
  */
280 265
 function any() {
@@ -293,8 +278,6 @@  discard block
 block discarded – undo
293 278
  *
294 279
  * @signature [*] -> [*] -> [*]
295 280
  * @signature String -> String -> String
296
- * @param  array $list1
297
- * @param  array $list2
298 281
  * @return array
299 282
  */
300 283
 function concat() {
@@ -314,7 +297,6 @@  discard block
 block discarded – undo
314 297
  * ```
315 298
  *
316 299
  * @signature [[a]] -> [a]
317
- * @param  array $lists
318 300
  * @return array
319 301
  */
320 302
 function concatAll() {
@@ -338,9 +320,6 @@  discard block
 block discarded – undo
338 320
  *
339 321
  * @signature Number -> a -> [a] -> [a]
340 322
  * @signature Number -> String -> String -> String
341
- * @param  int $position
342
- * @param  mixed $item
343
- * @param  array $list
344 323
  * @return array
345 324
  */
346 325
 function insert() {
@@ -365,9 +344,6 @@  discard block
 block discarded – undo
365 344
  *
366 345
  * @signature Number -> [a] -> [a] -> [a]
367 346
  * @signature Number -> String -> String -> String
368
- * @param  int $position
369
- * @param  mixed $items
370
- * @param  array $list
371 347
  * @return array
372 348
  */
373 349
 function insertAll() {
@@ -388,8 +364,6 @@  discard block
 block discarded – undo
388 364
  *
389 365
  * @signature * -> [*] -> [*]
390 366
  * @signature String -> String -> String
391
- * @param  mixed $item
392
- * @param  array $list
393 367
  * @return array
394 368
  */
395 369
 function append() {
@@ -409,8 +383,6 @@  discard block
 block discarded – undo
409 383
  *
410 384
  * @signature a -> [a] -> [a]
411 385
  * @signature String -> String -> String
412
- * @param  mixed $item
413
- * @param  array $list
414 386
  * @return array
415 387
  */
416 388
 function prepend() {
@@ -431,8 +403,6 @@  discard block
 block discarded – undo
431 403
  *
432 404
  * @signature Number -> [a] -> [a]
433 405
  * @signature Number -> String -> String
434
- * @param  int $count
435
- * @param  array $list
436 406
  * @return array
437 407
  */
438 408
 function take() {
@@ -461,8 +431,6 @@  discard block
 block discarded – undo
461 431
  * ```
462 432
  *
463 433
  * @signature (a -> Boolean) -> [a] -> [a]
464
- * @param  callable $predicate
465
- * @param  array $list
466 434
  * @return array
467 435
  */
468 436
 function takeWhile() {
@@ -485,8 +453,6 @@  discard block
 block discarded – undo
485 453
  * ```
486 454
  *
487 455
  * @signature (a -> Boolean) -> [a] -> [a]
488
- * @param  callable $predicate
489
- * @param  array $list
490 456
  * @return array
491 457
  */
492 458
 function takeLastWhile() {
@@ -510,8 +476,6 @@  discard block
 block discarded – undo
510 476
  * ```
511 477
  *
512 478
  * @signature (a -> Boolean) -> [a] -> [a]
513
- * @param  callable $predicate
514
- * @param  array $list
515 479
  * @return array
516 480
  */
517 481
 function takeUntil() {
@@ -530,8 +494,6 @@  discard block
 block discarded – undo
530 494
  * ```
531 495
  *
532 496
  * @signature (a -> Boolean) -> [a] -> [a]
533
- * @param  callable $predicate
534
- * @param  array $list
535 497
  * @return array
536 498
  */
537 499
 function takeLastUntil() {
@@ -556,8 +518,6 @@  discard block
 block discarded – undo
556 518
  *
557 519
  * @signature Number -> [a] -> [a]
558 520
  * @signature Number -> String -> String
559
- * @param  int $count
560
- * @param  array $list
561 521
  * @return array
562 522
  */
563 523
 function remove() {
@@ -582,8 +542,6 @@  discard block
 block discarded – undo
582 542
  * ```
583 543
  *
584 544
  * @signature (a -> Boolean) -> [a] -> [a]
585
- * @param  callable $predicate
586
- * @param  array $list
587 545
  * @return array
588 546
  */
589 547
 function removeWhile() {
@@ -602,8 +560,6 @@  discard block
 block discarded – undo
602 560
  * ```
603 561
  *
604 562
  * @signature (a -> Boolean) -> [a] -> [a]
605
- * @param  callable $predicate
606
- * @param  array $list
607 563
  * @return array
608 564
  */
609 565
 function removeLastWhile() {
@@ -624,8 +580,6 @@  discard block
 block discarded – undo
624 580
  * ```
625 581
  *
626 582
  * @signature (a -> Boolean) -> [a] -> [a]
627
- * @param  callable $predicate
628
- * @param  array $list
629 583
  * @return array
630 584
  */
631 585
 function removeUntil() {
@@ -645,8 +599,6 @@  discard block
 block discarded – undo
645 599
  * ```
646 600
  *
647 601
  * @signature (a -> Boolean) -> [a] -> [a]
648
- * @param  callable $predicate
649
- * @param  array $list
650 602
  * @return array
651 603
  */
652 604
 function removeLastUntil() {
@@ -663,7 +615,6 @@  discard block
 block discarded – undo
663 615
  * ```
664 616
  *
665 617
  * @signature [(k, v)] -> {k: v}
666
- * @param  array $pairs
667 618
  * @return stdClass
668 619
  */
669 620
 function fromPairs() {
@@ -689,8 +640,6 @@  discard block
 block discarded – undo
689 640
  *
690 641
  * @signature Number -> [a] -> [[a]]
691 642
  * @signature Number -> String -> [String]
692
- * @param  int $size
693
- * @param  array $list
694 643
  * @return array
695 644
  */
696 645
 function slices() {
@@ -715,8 +664,6 @@  discard block
 block discarded – undo
715 664
  *
716 665
  * @signature a -> [a] -> Boolean
717 666
  * @signature String -> String -> Boolean
718
- * @param  mixed $item
719
- * @param  array|string $list
720 667
  * @return bool
721 668
  */
722 669
 function contains() {
@@ -737,8 +684,6 @@  discard block
 block discarded – undo
737 684
  *
738 685
  * @signature (a -> Boolean) -> [a] -> Maybe(Number)
739 686
  * @signature (v -> Boolean) -> {k: v} -> Maybe(k)
740
- * @param  callable $predicate
741
- * @param  array $list
742 687
  * @return mixed
743 688
  */
744 689
 function findIndex() {
@@ -763,8 +708,6 @@  discard block
 block discarded – undo
763 708
  *
764 709
  * @signature (a -> Boolean) -> [a] -> Maybe(Number)
765 710
  * @signature (v -> Boolean) -> {k: v} -> Maybe(k)
766
- * @param  callable $predicate
767
- * @param  array $list
768 711
  * @return mixed
769 712
  */
770 713
 function findLastIndex() {
@@ -787,8 +730,6 @@  discard block
 block discarded – undo
787 730
  * ```
788 731
  *
789 732
  * @signature (a -> Boolean) -> [a] -> Maybe(a)
790
- * @param  callable $predicate
791
- * @param  array $list
792 733
  * @return mixed
793 734
  */
794 735
 function find() {
@@ -807,8 +748,6 @@  discard block
 block discarded – undo
807 748
  * ```
808 749
  *
809 750
  * @signature (a -> Boolean) -> [a] -> Maybe(a)
810
- * @param  callable $predicate
811
- * @param  array $list
812 751
  * @return mixed
813 752
  */
814 753
 function findLast() {
@@ -834,8 +773,6 @@  discard block
 block discarded – undo
834 773
  * @signature a -> [a] -> Maybe(Number) 
835 774
  * @signature v -> {k: v} -> Maybe(k)
836 775
  * @signature String -> String -> Maybe(Number)
837
- * @param  mixed $item
838
- * @param  array $list
839 776
  * @return int
840 777
  */
841 778
 function indexOf() {
@@ -863,8 +800,6 @@  discard block
 block discarded – undo
863 800
  *
864 801
  * @signature a -> [a] -> Number 
865 802
  * @signature String -> String -> Number
866
- * @param  mixed $item
867
- * @param  array $list
868 803
  * @return int
869 804
  */
870 805
 function lastIndexOf() {
@@ -888,8 +823,6 @@  discard block
 block discarded – undo
888 823
  * ```
889 824
  *
890 825
  * @signature (a -> a -> Boolean) -> [a] -> [a]
891
- * @param  callable $areEqual
892
- * @param  array $list
893 826
  * @return array
894 827
  */
895 828
 function uniqueBy() {
@@ -917,7 +850,6 @@  discard block
 block discarded – undo
917 850
  * ```
918 851
  *
919 852
  * @signature [a] -> [a]
920
- * @param  array $list
921 853
  * @return array
922 854
  */
923 855
 function unique() {
@@ -951,8 +883,6 @@  discard block
 block discarded – undo
951 883
  * ```
952 884
  *
953 885
  * @signature (a -> String) -> [a] -> {String: a}
954
- * @param  callable $fn
955
- * @param  array $list
956 886
  * @return array
957 887
  */
958 888
 function groupBy() {
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
  * @return array
57 57
  */
58 58
 function filter() {
59
-    $filter = function($fn, $list){
59
+    $filter = function($fn, $list) {
60 60
         return array_values(array_filter($list, $fn));
61 61
     };
62 62
     return apply(curry($filter), func_get_args());
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
  * @return array
79 79
  */
80 80
 function reduce() {
81
-    $reduce = function($fn, $initial, $list){
81
+    $reduce = function($fn, $initial, $list) {
82 82
         return array_reduce($list, $fn, $initial);
83 83
     };
84 84
     return apply(curry($reduce), func_get_args());
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
  * @return array
105 105
  */
106 106
 function each() {
107
-    $each = function($fn, $list){
107
+    $each = function($fn, $list) {
108 108
         foreach ($list as $item) {
109 109
             apply($fn, [$item]);
110 110
         }
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
  * @return mixed
129 129
  */
130 130
 function head($list) {
131
-    if(is_string($list))
131
+    if (is_string($list))
132 132
         return substr($list, 0, 1);
133 133
     return (count($list) > 0)
134 134
         ? $list[0]
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
  * @return mixed
151 151
  */
152 152
 function last($list) {
153
-    if(is_string($list))
153
+    if (is_string($list))
154 154
         return substr($list, -1);
155 155
     return (count($list) > 0)
156 156
         ? $list[count($list) - 1]
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
  * @return array
174 174
  */
175 175
 function init($list) {
176
-    if(is_string($list))
176
+    if (is_string($list))
177 177
         return (strlen($list) > 1)
178 178
             ? substr($list, 0, strlen($list) - 1)
179 179
             : '';
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
  * @return array
199 199
  */
200 200
 function tail($list) {
201
-    if(is_string($list))
201
+    if (is_string($list))
202 202
         return (strlen($list) > 1)
203 203
             ? substr($list, 1)
204 204
             : '';
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
  * @return array
394 394
  */
395 395
 function append() {
396
-    $append = function ($item, $list) {
396
+    $append = function($item, $list) {
397 397
         return concat($list, [$item]);
398 398
     };
399 399
     return apply(curry($append), func_get_args());
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
     $take = function($count, $list) {
440 440
         if ($count > $length || $count < -$length)
441 441
             return [];
442
-        if(is_string($list)) {
442
+        if (is_string($list)) {
443 443
             return ($count >= 0)
444 444
                 ? substr($list, 0, $count)
445 445
                 : substr($list, $count);
@@ -695,9 +695,9 @@  discard block
 block discarded – undo
695 695
  */
696 696
 function slices() {
697 697
     $slices = function($size, $list) {
698
-        if(empty($list))
698
+        if (empty($list))
699 699
             return is_string($list) ? '' : [];
700
-        if(length($list) <= $size)
700
+        if (length($list) <= $size)
701 701
             return [$list];
702 702
         return prepend(take($size, $list), slices($size, remove($size, $list)));
703 703
     };
@@ -770,7 +770,7 @@  discard block
 block discarded – undo
770 770
 function findLastIndex() {
771 771
     $findLastIndex = function($predicate, $list) {
772 772
         foreach (reverse(toPairs($list)) as $pair) {
773
-            if($predicate($pair[1]))
773
+            if ($predicate($pair[1]))
774 774
                 return $pair[0];
775 775
         }
776 776
         return null;
@@ -842,7 +842,7 @@  discard block
 block discarded – undo
842 842
     $indexOf = function($item, $list) {
843 843
         if (is_string($list)) {
844 844
             $index = strpos($list, $item);
845
-            return (-1 == $index)
845
+            return (- 1 == $index)
846 846
                 ? null
847 847
                 : $index;
848 848
         }
@@ -871,7 +871,7 @@  discard block
 block discarded – undo
871 871
     $lastIndexOf = function($item, $list) {
872 872
         if (is_string($list)) {
873 873
             $index = strrpos($list, $item);
874
-            return (-1 == $index)
874
+            return (- 1 == $index)
875 875
                 ? null
876 876
                 : $index;
877 877
         }
@@ -959,7 +959,7 @@  discard block
 block discarded – undo
959 959
     $groupBy = function($fn, $list) {
960 960
         return reduce(function($result, $item) use($fn) {
961 961
             $index = $fn($item);
962
-            if (! isset($result[$index]))
962
+            if (!isset($result[$index]))
963 963
                 $result[$index] = [];
964 964
             $result[$index][] = $item;
965 965
             return $result;
Please login to merge, or discard this patch.
Braces   +39 added lines, -26 removed lines patch added patch discarded remove patch
@@ -128,8 +128,9 @@  discard block
 block discarded – undo
128 128
  * @return mixed
129 129
  */
130 130
 function head($list) {
131
-    if(is_string($list))
132
-        return substr($list, 0, 1);
131
+    if(is_string($list)) {
132
+            return substr($list, 0, 1);
133
+    }
133 134
     return (count($list) > 0)
134 135
         ? $list[0]
135 136
         : null;
@@ -150,8 +151,9 @@  discard block
 block discarded – undo
150 151
  * @return mixed
151 152
  */
152 153
 function last($list) {
153
-    if(is_string($list))
154
-        return substr($list, -1);
154
+    if(is_string($list)) {
155
+            return substr($list, -1);
156
+    }
155 157
     return (count($list) > 0)
156 158
         ? $list[count($list) - 1]
157 159
         : null;
@@ -173,10 +175,11 @@  discard block
 block discarded – undo
173 175
  * @return array
174 176
  */
175 177
 function init($list) {
176
-    if(is_string($list))
177
-        return (strlen($list) > 1)
178
+    if(is_string($list)) {
179
+            return (strlen($list) > 1)
178 180
             ? substr($list, 0, strlen($list) - 1)
179 181
             : '';
182
+    }
180 183
     return (count($list) > 1)
181 184
         ? array_slice($list, 0, count($list) - 1)
182 185
         : [];
@@ -198,10 +201,11 @@  discard block
 block discarded – undo
198 201
  * @return array
199 202
  */
200 203
 function tail($list) {
201
-    if(is_string($list))
202
-        return (strlen($list) > 1)
204
+    if(is_string($list)) {
205
+            return (strlen($list) > 1)
203 206
             ? substr($list, 1)
204 207
             : '';
208
+    }
205 209
     return (count($list) > 1)
206 210
         ? array_slice($list, 1)
207 211
         : [];
@@ -299,8 +303,9 @@  discard block
 block discarded – undo
299 303
  */
300 304
 function concat() {
301 305
     $concat = function($list1, $list2) {
302
-        if (is_string($list1))
303
-            return $list1 . $list2;
306
+        if (is_string($list1)) {
307
+                    return $list1 . $list2;
308
+        }
304 309
         return array_merge($list1, $list2);
305 310
     };
306 311
     return apply(curry($concat), func_get_args());
@@ -372,8 +377,9 @@  discard block
 block discarded – undo
372 377
  */
373 378
 function insertAll() {
374 379
     $insertAll = function($position, $items, $list) {
375
-        if ($position < 0)
376
-            $position = length($list) - $position;
380
+        if ($position < 0) {
381
+                    $position = length($list) - $position;
382
+        }
377 383
         return concatAll([take($position, $list), $items, remove($position, $list)]);
378 384
     };
379 385
     return apply(curry($insertAll), func_get_args());
@@ -437,8 +443,9 @@  discard block
 block discarded – undo
437 443
  */
438 444
 function take() {
439 445
     $take = function($count, $list) {
440
-        if ($count > $length || $count < -$length)
441
-            return [];
446
+        if ($count > $length || $count < -$length) {
447
+                    return [];
448
+        }
442 449
         if(is_string($list)) {
443 450
             return ($count >= 0)
444 451
                 ? substr($list, 0, $count)
@@ -563,8 +570,9 @@  discard block
 block discarded – undo
563 570
 function remove() {
564 571
     $remove = function($count, $list) {
565 572
         $length = length($list);
566
-        if ($count > $length || $count < -$length)
567
-            return [];
573
+        if ($count > $length || $count < -$length) {
574
+                    return [];
575
+        }
568 576
         return ($count > 0) 
569 577
             ? take($count - $length)
570 578
             : take($count + $length);
@@ -695,10 +703,12 @@  discard block
 block discarded – undo
695 703
  */
696 704
 function slices() {
697 705
     $slices = function($size, $list) {
698
-        if(empty($list))
699
-            return is_string($list) ? '' : [];
700
-        if(length($list) <= $size)
701
-            return [$list];
706
+        if(empty($list)) {
707
+                    return is_string($list) ? '' : [];
708
+        }
709
+        if(length($list) <= $size) {
710
+                    return [$list];
711
+        }
702 712
         return prepend(take($size, $list), slices($size, remove($size, $list)));
703 713
     };
704 714
     return apply(curry($slices), func_get_args());
@@ -744,8 +754,9 @@  discard block
 block discarded – undo
744 754
 function findIndex() {
745 755
     $findIndex = function($predicate, $list) {
746 756
         foreach ($list as $key => $value) {
747
-            if ($predicate($value))
748
-                return $key;
757
+            if ($predicate($value)) {
758
+                            return $key;
759
+            }
749 760
         }
750 761
         return null;
751 762
     };
@@ -770,8 +781,9 @@  discard block
 block discarded – undo
770 781
 function findLastIndex() {
771 782
     $findLastIndex = function($predicate, $list) {
772 783
         foreach (reverse(toPairs($list)) as $pair) {
773
-            if($predicate($pair[1]))
774
-                return $pair[0];
784
+            if($predicate($pair[1])) {
785
+                            return $pair[0];
786
+            }
775 787
         }
776 788
         return null;
777 789
     };
@@ -959,8 +971,9 @@  discard block
 block discarded – undo
959 971
     $groupBy = function($fn, $list) {
960 972
         return reduce(function($result, $item) use($fn) {
961 973
             $index = $fn($item);
962
-            if (! isset($result[$index]))
963
-                $result[$index] = [];
974
+            if (! isset($result[$index])) {
975
+                            $result[$index] = [];
976
+            }
964 977
             $result[$index][] = $item;
965 978
             return $result;
966 979
         }, [], $list);
Please login to merge, or discard this patch.
src/object.php 3 patches
Doc Comments   -5 removed lines patch added patch discarded remove patch
@@ -27,7 +27,6 @@  discard block
 block discarded – undo
27 27
  * ```
28 28
  *
29 29
  * @signature {k: v} -> {k: v}
30
- * @param  object $object
31 30
  * @return array
32 31
  */
33 32
 function attributes() {
@@ -95,8 +94,6 @@  discard block
 block discarded – undo
95 94
  * ```
96 95
  *
97 96
  * @signature String|Number -> [key => *] -> Boolean
98
- * @param  string $name
99
- * @param  array $object
100 97
  * @return mixed
101 98
  */
102 99
 function has() {
@@ -125,8 +122,6 @@  discard block
 block discarded – undo
125 122
  * ```
126 123
  *
127 124
  * @signature k -> {k: v} -> Maybe(v)
128
- * @param  string $name
129
- * @param  array $object
130 125
  * @return mixed
131 126
  */
132 127
 function get() {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
  * @return mixed
101 101
  */
102 102
 function has() {
103
-    $has = function($name, $object){
103
+    $has = function($name, $object) {
104 104
         return contains($name, keys($object));
105 105
     };
106 106
     return apply(curry($has), func_get_args());
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
  * @return mixed
131 131
  */
132 132
 function get() {
133
-    $get = function($name, $object){
133
+    $get = function($name, $object) {
134 134
         $object = attributes($object);
135 135
         return has($name, $object)
136 136
             ? $object[$name]
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,8 +32,9 @@
 block discarded – undo
32 32
  */
33 33
 function attributes() {
34 34
     $attrs = function($object) {
35
-        if (is_object($object))
36
-            return get_object_vars($object);
35
+        if (is_object($object)) {
36
+                    return get_object_vars($object);
37
+        }
37 38
         return $object;
38 39
     };
39 40
     return apply(curry($attrs), func_get_args());
Please login to merge, or discard this patch.
src/operators.php 3 patches
Doc Comments   -19 removed lines patch added patch discarded remove patch
@@ -8,8 +8,6 @@  discard block
 block discarded – undo
8 8
  * Returns `$a && $b`.
9 9
  *
10 10
  * @signature Boolean -> Boolean -> Boolean
11
- * @param  bool $a
12
- * @param  bool $b
13 11
  * @return bool
14 12
  */
15 13
 function and_() {
@@ -22,8 +20,6 @@  discard block
 block discarded – undo
22 20
  * Returns `$a || $b`.
23 21
  *
24 22
  * @signature Boolean -> Boolean -> Boolean
25
- * @param  bool $a
26
- * @param  bool $b
27 23
  * @return bool
28 24
  */
29 25
 function or_() {
@@ -36,7 +32,6 @@  discard block
 block discarded – undo
36 32
  * Returns `!$x`.
37 33
  *
38 34
  * @signature Boolean -> Boolean
39
- * @param  bool $x
40 35
  * @return bool
41 36
  */
42 37
 function not() {
@@ -50,8 +45,6 @@  discard block
 block discarded – undo
50 45
  * Returns `$x == $y`.
51 46
  *
52 47
  * @signature * -> * -> Boolean
53
- * @param  mixed $a
54
- * @param  mixed $b
55 48
  * @return bool
56 49
  */
57 50
 function eq() {
@@ -64,8 +57,6 @@  discard block
 block discarded – undo
64 57
  * Returns `$x === $y`.
65 58
  *
66 59
  * @signature * -> * -> Boolean
67
- * @param  mixed $a
68
- * @param  mixed $b
69 60
  * @return bool
70 61
  */
71 62
 function eqq() {
@@ -90,8 +81,6 @@  discard block
 block discarded – undo
90 81
  * ```
91 82
  *
92 83
  * @signature * -> * -> Boolean
93
- * @param  mixed $a
94
- * @param  mixed $b
95 84
  * @return bool
96 85
  */
97 86
 function equals() {
@@ -129,8 +118,6 @@  discard block
 block discarded – undo
129 118
  * Returns `$a < $b`.
130 119
  *
131 120
  * @signature * -> * -> Boolean
132
- * @param  mixed $a
133
- * @param  mixed $b
134 121
  * @return bool
135 122
  */
136 123
 function lt() {
@@ -143,8 +130,6 @@  discard block
 block discarded – undo
143 130
  * Returns `$a <= $b`.
144 131
  *
145 132
  * @signature * -> * -> Boolean
146
- * @param  mixed $a
147
- * @param  mixed $b
148 133
  * @return bool
149 134
  */
150 135
 function lte() {
@@ -157,8 +142,6 @@  discard block
 block discarded – undo
157 142
  * Returns `$a > $b`.
158 143
  *
159 144
  * @signature * -> * -> Boolean
160
- * @param  mixed $a
161
- * @param  mixed $b
162 145
  * @return bool
163 146
  */
164 147
 function gt() {
@@ -171,8 +154,6 @@  discard block
 block discarded – undo
171 154
  * Returns `$a >= $b`.
172 155
  *
173 156
  * @signature * -> * -> Boolean
174
- * @param  mixed $a
175
- * @param  mixed $b
176 157
  * @return bool
177 158
  */
178 159
 function gte() {
Please login to merge, or discard this patch.
Spacing   +9 added lines, -11 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
  * @return bool
14 14
  */
15 15
 function and_() {
16
-    return apply(curry(function($a, $b){
16
+    return apply(curry(function($a, $b) {
17 17
         return $a && $b;
18 18
     }), func_get_args());
19 19
 }
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
  * @return bool
28 28
  */
29 29
 function or_() {
30
-    return apply(curry(function($a, $b){
30
+    return apply(curry(function($a, $b) {
31 31
         return $a || $b;
32 32
     }), func_get_args());
33 33
 }
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
  * @return bool
56 56
  */
57 57
 function eq() {
58
-    return apply(curry(function($a, $b){
58
+    return apply(curry(function($a, $b) {
59 59
         return $a == $b;
60 60
     }), func_get_args());
61 61
 }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
  * @return bool
70 70
  */
71 71
 function eqq() {
72
-    return apply(curry(function($a, $b){
72
+    return apply(curry(function($a, $b) {
73 73
         return $a === $b;
74 74
     }), func_get_args());
75 75
 }
@@ -112,9 +112,7 @@  discard block
 block discarded – undo
112 112
                     return $a == $b;
113 113
                 case 'List':
114 114
                     $length = length($a);
115
-                    return length($b) != $length ? false :
116
-                           0 == $length ? true :
117
-                           equals(head($a), head($b)) && equals(tail($a), tail($b));
115
+                    return length($b) != $length ? false : 0 == $length ? true : equals(head($a), head($b)) && equals(tail($a), tail($b));
118 116
                 case 'Array':
119 117
                 case 'ArrayObject':
120 118
                 case 'Object':
@@ -134,7 +132,7 @@  discard block
 block discarded – undo
134 132
  * @return bool
135 133
  */
136 134
 function lt() {
137
-    return apply(curry(function($a, $b){
135
+    return apply(curry(function($a, $b) {
138 136
         return $a < $b;
139 137
     }), func_get_args());
140 138
 }
@@ -148,7 +146,7 @@  discard block
 block discarded – undo
148 146
  * @return bool
149 147
  */
150 148
 function lte() {
151
-    return apply(curry(function($a, $b){
149
+    return apply(curry(function($a, $b) {
152 150
         return $a <= $b;
153 151
     }), func_get_args());
154 152
 }
@@ -162,7 +160,7 @@  discard block
 block discarded – undo
162 160
  * @return bool
163 161
  */
164 162
 function gt() {
165
-    return apply(curry(function($a, $b){
163
+    return apply(curry(function($a, $b) {
166 164
         return $a > $b;
167 165
     }), func_get_args());
168 166
 }
@@ -176,7 +174,7 @@  discard block
 block discarded – undo
176 174
  * @return bool
177 175
  */
178 176
 function gte() {
179
-    return apply(curry(function($a, $b){
177
+    return apply(curry(function($a, $b) {
180 178
         return $a >= $b;
181 179
     }), func_get_args());
182 180
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -97,8 +97,9 @@
 block discarded – undo
97 97
 function equals() {
98 98
     $equals = function($a, $b) {
99 99
             $type = type($a);
100
-            if ($type != type($b))
101
-                return false;
100
+            if ($type != type($b)) {
101
+                            return false;
102
+            }
102 103
             switch ($type) {
103 104
                 case 'Null':
104 105
                 case 'Boolean':
Please login to merge, or discard this patch.