@@ -8,8 +8,6 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 notEq() { |
@@ -78,8 +69,6 @@ discard block |
||
78 | 69 | * Returns `$x === $y`. |
79 | 70 | * |
80 | 71 | * @signature * -> * -> Boolean |
81 | - * @param mixed $a |
|
82 | - * @param mixed $b |
|
83 | 72 | * @return bool |
84 | 73 | */ |
85 | 74 | function eqq() { |
@@ -92,8 +81,6 @@ discard block |
||
92 | 81 | * Returns `$x !== $y`. |
93 | 82 | * |
94 | 83 | * @signature * -> * -> Boolean |
95 | - * @param mixed $a |
|
96 | - * @param mixed $b |
|
97 | 84 | * @return bool |
98 | 85 | */ |
99 | 86 | function notEqq() { |
@@ -118,8 +105,6 @@ discard block |
||
118 | 105 | * ``` |
119 | 106 | * |
120 | 107 | * @signature * -> * -> Boolean |
121 | - * @param mixed $a |
|
122 | - * @param mixed $b |
|
123 | 108 | * @return bool |
124 | 109 | */ |
125 | 110 | function equals() { |
@@ -157,8 +142,6 @@ discard block |
||
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 lt() { |
@@ -171,8 +154,6 @@ discard block |
||
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 lte() { |
@@ -185,8 +166,6 @@ discard block |
||
185 | 166 | * Returns `$a > $b`. |
186 | 167 | * |
187 | 168 | * @signature * -> * -> Boolean |
188 | - * @param mixed $a |
|
189 | - * @param mixed $b |
|
190 | 169 | * @return bool |
191 | 170 | */ |
192 | 171 | function gt() { |
@@ -199,8 +178,6 @@ discard block |
||
199 | 178 | * Returns `$a >= $b`. |
200 | 179 | * |
201 | 180 | * @signature * -> * -> Boolean |
202 | - * @param mixed $a |
|
203 | - * @param mixed $b |
|
204 | 181 | * @return bool |
205 | 182 | */ |
206 | 183 | function gte() { |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | */ |
23 | 23 | function and_() { |
24 | 24 | static $and = false; |
25 | - $and = $and ?: curry(function($a, $b){ |
|
25 | + $and = $and ?: curry(function($a, $b) { |
|
26 | 26 | return $a && $b; |
27 | 27 | }); |
28 | 28 | return _apply($and, func_get_args()); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | function or_() { |
47 | 47 | static $or = false; |
48 | - $or = $or ?: curry(function($a, $b){ |
|
48 | + $or = $or ?: curry(function($a, $b) { |
|
49 | 49 | return $a || $b; |
50 | 50 | }); |
51 | 51 | return _apply($or, func_get_args()); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * @return bool |
86 | 86 | */ |
87 | 87 | function eq() { |
88 | - $eq = curry(function($a, $b){ |
|
88 | + $eq = curry(function($a, $b) { |
|
89 | 89 | return $a == $b; |
90 | 90 | }); |
91 | 91 | return _apply($eq, func_get_args()); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | */ |
107 | 107 | function notEq() { |
108 | 108 | static $notEq = false; |
109 | - $notEq = $notEq ?: curry(function($a, $b){ |
|
109 | + $notEq = $notEq ?: curry(function($a, $b) { |
|
110 | 110 | return $a != $b; |
111 | 111 | }); |
112 | 112 | return _apply($notEq, func_get_args()); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | function eqq() { |
128 | 128 | static $eqq = false; |
129 | - $eqq = $eqq ?: curry(function($a, $b){ |
|
129 | + $eqq = $eqq ?: curry(function($a, $b) { |
|
130 | 130 | return $a === $b; |
131 | 131 | }); |
132 | 132 | return _apply($eqq, func_get_args()); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | */ |
148 | 148 | function notEqq() { |
149 | 149 | static $notEqq = false; |
150 | - $notEqq = $notEqq ?: curry(function($a, $b){ |
|
150 | + $notEqq = $notEqq ?: curry(function($a, $b) { |
|
151 | 151 | return $a !== $b; |
152 | 152 | }); |
153 | 153 | return _apply($notEqq, func_get_args()); |
@@ -196,9 +196,7 @@ discard block |
||
196 | 196 | return $a == $b; |
197 | 197 | case 'List': |
198 | 198 | $length = length($a); |
199 | - return length($b) != $length ? false : |
|
200 | - 0 == $length ? true : |
|
201 | - equals(head($a), head($b)) && equals(tail($a), tail($b)); |
|
199 | + return length($b) != $length ? false : 0 == $length ? true : equals(head($a), head($b)) && equals(tail($a), tail($b)); |
|
202 | 200 | case 'Array': |
203 | 201 | case 'ArrayObject': |
204 | 202 | case 'Object': |
@@ -252,7 +250,7 @@ discard block |
||
252 | 250 | */ |
253 | 251 | function lt() { |
254 | 252 | static $lt = false; |
255 | - $lt = $lt ?: curry(function($a, $b){ |
|
253 | + $lt = $lt ?: curry(function($a, $b) { |
|
256 | 254 | return $a < $b; |
257 | 255 | }); |
258 | 256 | return _apply($lt, func_get_args()); |
@@ -274,7 +272,7 @@ discard block |
||
274 | 272 | */ |
275 | 273 | function lte() { |
276 | 274 | static $lte = false; |
277 | - $lte = $lte ?: curry(function($a, $b){ |
|
275 | + $lte = $lte ?: curry(function($a, $b) { |
|
278 | 276 | return $a <= $b; |
279 | 277 | }); |
280 | 278 | return _apply($lte, func_get_args()); |
@@ -296,7 +294,7 @@ discard block |
||
296 | 294 | */ |
297 | 295 | function gt() { |
298 | 296 | static $gt = false; |
299 | - $gt = $gt ?: curry(function($a, $b){ |
|
297 | + $gt = $gt ?: curry(function($a, $b) { |
|
300 | 298 | return $a > $b; |
301 | 299 | }); |
302 | 300 | return _apply($gt, func_get_args()); |
@@ -318,7 +316,7 @@ discard block |
||
318 | 316 | */ |
319 | 317 | function gte() { |
320 | 318 | static $gte = false; |
321 | - $gte = $gte ?: curry(function($a, $b){ |
|
319 | + $gte = $gte ?: curry(function($a, $b) { |
|
322 | 320 | return $a >= $b; |
323 | 321 | }); |
324 | 322 | return _apply($gte, func_get_args()); |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * @param mixed $something |
83 | 83 | * @return string |
84 | 84 | */ |
85 | -function toString () { |
|
85 | +function toString() { |
|
86 | 86 | $toString = function($something) { |
87 | 87 | switch (type($something)) { |
88 | 88 | case 'String': |
@@ -105,11 +105,11 @@ discard block |
||
105 | 105 | return $something->__toString(); |
106 | 106 | case 'Object': |
107 | 107 | case 'Array': |
108 | - return '{' . join(', ', map(function($pair){ |
|
109 | - return $pair[0].': '. toString($pair[1]); |
|
108 | + return '{' . join(', ', map(function($pair) { |
|
109 | + return $pair[0] . ': ' . toString($pair[1]); |
|
110 | 110 | }, toPairs($something))) . '}'; |
111 | 111 | default: |
112 | - return '['.type($something).']'; |
|
112 | + return '[' . type($something) . ']'; |
|
113 | 113 | } |
114 | 114 | }; |
115 | 115 | return apply(curry($toString), func_get_args()); |
@@ -26,7 +26,6 @@ discard block |
||
26 | 26 | * ``` |
27 | 27 | * |
28 | 28 | * @signature * -> String |
29 | - * @param mixed $data |
|
30 | 29 | * @return string |
31 | 30 | */ |
32 | 31 | function type() { |
@@ -73,8 +72,6 @@ discard block |
||
73 | 72 | * |
74 | 73 | * @stream |
75 | 74 | * @signature String -> * -> Boolean |
76 | - * @param string $type |
|
77 | - * @param mixed $data |
|
78 | 75 | * @return boolean |
79 | 76 | */ |
80 | 77 | function is() { |
@@ -109,7 +106,6 @@ discard block |
||
109 | 106 | * |
110 | 107 | * @stream |
111 | 108 | * @signature * -> String |
112 | - * @param mixed $something |
|
113 | 109 | * @return string |
114 | 110 | */ |
115 | 111 | function toString () { |
@@ -634,8 +634,6 @@ discard block |
||
634 | 634 | * Gets an element of the stream methods list. |
635 | 635 | * |
636 | 636 | * @signature String -> Block -> String |
637 | - * @param string $moduleName |
|
638 | - * @param object $block |
|
639 | 637 | * @return string |
640 | 638 | */ |
641 | 639 | function stream_method_link() { |
@@ -661,7 +659,6 @@ discard block |
||
661 | 659 | * Dump a variable and returns it. |
662 | 660 | * |
663 | 661 | * @signature a -> a |
664 | - * @param mixed $something |
|
665 | 662 | * @return mixed |
666 | 663 | */ |
667 | 664 | function log() { |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | * @return array |
117 | 117 | */ |
118 | 118 | function get_modules() { |
119 | - $composer = json_decode(file_get_contents(__DIR__.'/composer.json')); |
|
119 | + $composer = json_decode(file_get_contents(__DIR__ . '/composer.json')); |
|
120 | 120 | return $composer->autoload->files; |
121 | 121 | } |
122 | 122 | |
@@ -147,10 +147,10 @@ discard block |
||
147 | 147 | */ |
148 | 148 | function write_module($module) { |
149 | 149 | if ($module->docs) { |
150 | - $docsDir = dirname($module->docsPath); |
|
150 | + $docsDir = dirname($module->docsPath); |
|
151 | 151 | if (!is_dir($docsDir)) |
152 | 152 | mkdir($docsDir, 0777, true); |
153 | - file_put_contents($module->docsPath, $module->docs); |
|
153 | + file_put_contents($module->docsPath, $module->docs); |
|
154 | 154 | } |
155 | 155 | if ($module->tests) { |
156 | 156 | $testsDir = dirname($module->testsPath); |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | 'fill_docs_path', |
180 | 180 | 'fill_tests_path', |
181 | 181 | 'fill_blocks' |
182 | - ]), [(object)['path' => $path]]); |
|
182 | + ]), [(object) ['path' => $path]]); |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | /** |
@@ -233,8 +233,8 @@ discard block |
||
233 | 233 | function fill_blocks($module) { |
234 | 234 | $module->blocks = apply(pipe( |
235 | 235 | prepend('dox -r < '), // "dox -r < src/...php" |
236 | - 'shell_exec', // "[{...}, ...]" |
|
237 | - 'json_decode', // [DoxBlock] |
|
236 | + 'shell_exec', // "[{...}, ...]" |
|
237 | + 'json_decode', // [DoxBlock] |
|
238 | 238 | map(_f('make_block')) |
239 | 239 | // sort() |
240 | 240 | ), [$module->path]); |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | if (has('class', $tags)) $type = 'class'; |
257 | 257 | if (has('method', $tags)) $type = 'method'; |
258 | 258 | |
259 | - $params = map(function($tag){ |
|
259 | + $params = map(function($tag) { |
|
260 | 260 | $parts = split(' ', get('value', $tag)); |
261 | 261 | return [ |
262 | 262 | 'type' => $parts[0], |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | */ |
293 | 293 | function tags_of($doxBlock) { |
294 | 294 | if ($doxBlock->tags) |
295 | - return map(function($tag){ |
|
295 | + return map(function($tag) { |
|
296 | 296 | return (object) [ |
297 | 297 | 'name' => $tag->type, |
298 | 298 | 'value' => $tag->string |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | * @return object |
342 | 342 | */ |
343 | 343 | function generate_docs_sommaire($module) { |
344 | - $blocks = filter ( |
|
344 | + $blocks = filter( |
|
345 | 345 | satisfiesAll(['ignore' => not(), 'internal' => not(), 'type' => equals('function')]), |
346 | 346 | $module->blocks |
347 | 347 | ); |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | * @return object |
372 | 372 | */ |
373 | 373 | function generate_docs_contents($module) { |
374 | - $blocks = filter ( |
|
374 | + $blocks = filter( |
|
375 | 375 | satisfiesAll(['ignore' => not(), 'internal' => not()]), |
376 | 376 | $module->blocks |
377 | 377 | ); |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | $additionalNamespace = replace("/", "\\", remove(6, dirname($module->testsPath))); |
430 | 430 | if ($additionalNamespace) |
431 | 431 | $namespace .= "\\" . $additionalNamespace; |
432 | - $name = remove(-4, last(split("/", $module->testsPath))); |
|
432 | + $name = remove(- 4, last(split("/", $module->testsPath))); |
|
433 | 433 | $module->tests .= "<?php namespace {$namespace};\n\nuse Tarsana\Functional as F;\n\nclass {$name} extends \Tarsana\UnitTests\Functional\UnitTest {\n"; |
434 | 434 | return $module; |
435 | 435 | } |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | * @return object |
443 | 443 | */ |
444 | 444 | function generate_tests_contents($module) { |
445 | - $blocks = filter ( |
|
445 | + $blocks = filter( |
|
446 | 446 | satisfiesAll(['ignore' => not()]), |
447 | 447 | $module->blocks |
448 | 448 | ); |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | if (!contains('```php', $description)) |
500 | 500 | return ''; |
501 | 501 | $code = remove(7 + indexOf('```php', $description), $description); |
502 | - return remove(-4, trim($code)); |
|
502 | + return remove(- 4, trim($code)); |
|
503 | 503 | } |
504 | 504 | |
505 | 505 | /** |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | * @return array |
553 | 553 | */ |
554 | 554 | function generate_stream_operations($module) { |
555 | - $blocks = filter ( |
|
555 | + $blocks = filter( |
|
556 | 556 | satisfiesAll(['ignore' => equals(false), 'stream' => equals(true)]), |
557 | 557 | $module->blocks |
558 | 558 | ); |
@@ -621,7 +621,7 @@ discard block |
||
621 | 621 | * @return array |
622 | 622 | */ |
623 | 623 | function generate_stream_methods($module) { |
624 | - $blocks = filter ( |
|
624 | + $blocks = filter( |
|
625 | 625 | satisfiesAll(['ignore' => equals(false), 'stream' => equals(true)]), |
626 | 626 | $module->blocks |
627 | 627 | ); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * Creates a new Stream. |
37 | 37 | * |
38 | 38 | * @param mixed $data |
39 | - * @return Tarsana\Functional\Stream |
|
39 | + * @return Stream |
|
40 | 40 | */ |
41 | 41 | public static function of($data) |
42 | 42 | { |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * Adds a new operation to the Stream class. |
48 | 48 | * |
49 | 49 | * @param string $name |
50 | - * @param string $signature |
|
50 | + * @param string $signatures |
|
51 | 51 | * @param callable $fn |
52 | 52 | * @return void |
53 | 53 | */ |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * Checks if the Stream class has an operation with the given name. |
66 | 66 | * |
67 | 67 | * @param string $name |
68 | - * @return boolean |
|
68 | + * @return \PHPUnit_Framework_Constraint_TraversableContains |
|
69 | 69 | */ |
70 | 70 | public static function hasOperation($name) |
71 | 71 | { |
@@ -87,7 +87,6 @@ discard block |
||
87 | 87 | /** |
88 | 88 | * Creates a new Stream with some data. |
89 | 89 | * |
90 | - * @param mixed $data |
|
91 | 90 | */ |
92 | 91 | protected function __construct($stream) |
93 | 92 | { |
@@ -120,7 +119,7 @@ discard block |
||
120 | 119 | * |
121 | 120 | * @param string $name The name of the operation |
122 | 121 | * @param array $args |
123 | - * @return Tarsana\Functional\Stream |
|
122 | + * @return Stream |
|
124 | 123 | */ |
125 | 124 | public function __call($name, $args) |
126 | 125 | { |
@@ -53,7 +53,7 @@ |
||
53 | 53 | */ |
54 | 54 | public static function operation($name, $signatures, $fn = null) |
55 | 55 | { |
56 | - if (! is_array($signatures)) { |
|
56 | + if (!is_array($signatures)) { |
|
57 | 57 | $signatures = [$signatures]; |
58 | 58 | } |
59 | 59 | foreach ($signatures as $signature) { |
@@ -85,7 +85,7 @@ |
||
85 | 85 | * @param callable $fn |
86 | 86 | * @param int $argsCount |
87 | 87 | * @param array $boundArgs |
88 | - * @return callable |
|
88 | + * @return \Closure |
|
89 | 89 | */ |
90 | 90 | function _curried_function($fn, $argsCount, $boundArgs = []) { |
91 | 91 | return function() use($fn, $argsCount, $boundArgs) { |
@@ -32,8 +32,7 @@ discard block |
||
32 | 32 | */ |
33 | 33 | function _number_of_args($fn) { |
34 | 34 | $reflector = is_array($fn) ? |
35 | - new \ReflectionMethod($fn[0], $fn[1]) : |
|
36 | - new \ReflectionFunction($fn); |
|
35 | + new \ReflectionMethod($fn[0], $fn[1]) : new \ReflectionFunction($fn); |
|
37 | 36 | return $reflector->getNumberOfRequiredParameters(); |
38 | 37 | } |
39 | 38 | |
@@ -65,7 +64,7 @@ discard block |
||
65 | 64 | $addArgument = function($currentBoundArgs, $arg) use($fnArgsCount) { |
66 | 65 | $currentBoundArgsCount = count($currentBoundArgs); |
67 | 66 | $placeholderPosition = 0; |
68 | - while($placeholderPosition < $currentBoundArgsCount && !_is_placeholder($currentBoundArgs[$placeholderPosition])) |
|
67 | + while ($placeholderPosition < $currentBoundArgsCount && !_is_placeholder($currentBoundArgs[$placeholderPosition])) |
|
69 | 68 | $placeholderPosition ++; |
70 | 69 | if ($currentBoundArgsCount < $fnArgsCount || $placeholderPosition == $currentBoundArgsCount) { |
71 | 70 | $currentBoundArgs[] = $arg; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * Returns supported types in signatures. |
41 | 41 | * |
42 | 42 | * @signature List |
43 | - * @return array |
|
43 | + * @return string[] |
|
44 | 44 | */ |
45 | 45 | function _stream_types() { |
46 | 46 | return [ |
@@ -126,7 +126,6 @@ discard block |
||
126 | 126 | * @signature String -> String -> Maybe(Function) -> Operation |
127 | 127 | * @param string $name |
128 | 128 | * @param string $signature |
129 | - * @param callable $fn |
|
130 | 129 | * @return array |
131 | 130 | */ |
132 | 131 | function _stream_operation($name, $signature, $callable = null) { |
@@ -190,8 +189,6 @@ discard block |
||
190 | 189 | * F\_stream_ensure_type('List -> Bar', 'Bar'); // throws "Stream: invalid signature 'List -> Bar' it should follow the syntax 'TypeArg1 -> TypeArg2 -> ... -> ReturnType' and types to use are Boolean, Number, String, Resource, Function, List, Array, Object, Any" |
191 | 190 | * ``` |
192 | 191 | * @signature String -> String -> String |
193 | - * @param string $signature |
|
194 | - * @param string $type |
|
195 | 192 | * @return string |
196 | 193 | */ |
197 | 194 | function _stream_ensure_type() { |
@@ -491,8 +488,6 @@ discard block |
||
491 | 488 | * ``` |
492 | 489 | * |
493 | 490 | * @signature [String] -> Operation -> Boolean |
494 | - * @param array $argsTypes |
|
495 | - * @param array $operation |
|
496 | 491 | * @return bool |
497 | 492 | */ |
498 | 493 | function _stream_operation_is_applicable() { |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | if (length($parts) < 2) |
167 | 167 | _stream_throw_error('invalid-signature', $text); |
168 | 168 | |
169 | - return reduce(function($result, $part){ |
|
169 | + return reduce(function($result, $part) { |
|
170 | 170 | return chain(function($item) use($result){ |
171 | 171 | return map(append($item), $result); |
172 | 172 | }, $part); |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | */ |
197 | 197 | function _stream_ensure_type() { |
198 | 198 | $ensureType = function($signature, $type) { |
199 | - if (! contains($type, _stream_types())) |
|
199 | + if (!contains($type, _stream_types())) |
|
200 | 200 | _stream_throw_error('invalid-signature', $signature); |
201 | 201 | return $type; |
202 | 202 | }; |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | $args = append(get('data', $stream), get('args', $transformation)); |
572 | 572 | $argsTypes = map(type(), $args); |
573 | 573 | $operation = get('operation', $transformation); |
574 | - if (! _stream_operation_is_applicable($argsTypes, $operation)) { |
|
574 | + if (!_stream_operation_is_applicable($argsTypes, $operation)) { |
|
575 | 575 | _stream_throw_error('wrong-transformation-args', $operation['name'], $argsTypes, init(head(get('signatures', $operation)))); |
576 | 576 | } |
577 | 577 |
@@ -14,8 +14,6 @@ discard block |
||
14 | 14 | * |
15 | 15 | * @stream |
16 | 16 | * @signature (a -> b) -> [a] -> [b] |
17 | - * @param callable $fn |
|
18 | - * @param array $list |
|
19 | 17 | * @return array |
20 | 18 | */ |
21 | 19 | function map() { |
@@ -37,8 +35,6 @@ discard block |
||
37 | 35 | * |
38 | 36 | * @stream |
39 | 37 | * @signature (a -> [b]) -> [a] -> [b] |
40 | - * @param callable $fn |
|
41 | - * @param array $list |
|
42 | 38 | * @return array |
43 | 39 | */ |
44 | 40 | function chain() { |
@@ -60,8 +56,6 @@ discard block |
||
60 | 56 | * ``` |
61 | 57 | * @stream |
62 | 58 | * @signature (a -> Boolean) -> [a] -> [a] |
63 | - * @param callable $fn |
|
64 | - * @param array $list |
|
65 | 59 | * @return array |
66 | 60 | */ |
67 | 61 | function filter() { |
@@ -84,9 +78,6 @@ discard block |
||
84 | 78 | * |
85 | 79 | * @stream |
86 | 80 | * @signature (* -> a -> *) -> * -> [a] -> * |
87 | - * @param callable $fn |
|
88 | - * @param mixed $initial |
|
89 | - * @param array $list |
|
90 | 81 | * @return array |
91 | 82 | */ |
92 | 83 | function reduce() { |
@@ -112,8 +103,6 @@ discard block |
||
112 | 103 | * |
113 | 104 | * @stream |
114 | 105 | * @signature (a -> *) -> [a] -> [a] |
115 | - * @param callable $fn |
|
116 | - * @param array $list |
|
117 | 106 | * @return array |
118 | 107 | */ |
119 | 108 | function each() { |
@@ -140,7 +129,6 @@ discard block |
||
140 | 129 | * @stream |
141 | 130 | * @signature [a] -> a |
142 | 131 | * @signature String -> String |
143 | - * @param array|string $list |
|
144 | 132 | * @return mixed |
145 | 133 | */ |
146 | 134 | function head() { |
@@ -168,7 +156,6 @@ discard block |
||
168 | 156 | * @stream |
169 | 157 | * @signature [a] -> a |
170 | 158 | * @signature String -> String |
171 | - * @param array|string $list |
|
172 | 159 | * @return mixed |
173 | 160 | */ |
174 | 161 | function last () { |
@@ -197,7 +184,6 @@ discard block |
||
197 | 184 | * @stream |
198 | 185 | * @signature [a] -> a |
199 | 186 | * @signature String -> String |
200 | - * @param array|string $list |
|
201 | 187 | * @return array |
202 | 188 | */ |
203 | 189 | function init () { |
@@ -228,7 +214,6 @@ discard block |
||
228 | 214 | * @stream |
229 | 215 | * @signature [a] -> a |
230 | 216 | * @signature String -> String |
231 | - * @param array|string $list |
|
232 | 217 | * @return array |
233 | 218 | */ |
234 | 219 | function tail () { |
@@ -256,7 +241,6 @@ discard block |
||
256 | 241 | * @stream |
257 | 242 | * @signature [a] -> [a] |
258 | 243 | * @signature String -> String |
259 | - * @param array|string $list |
|
260 | 244 | * @return array |
261 | 245 | */ |
262 | 246 | function reverse () { |
@@ -280,7 +264,6 @@ discard block |
||
280 | 264 | * @stream |
281 | 265 | * @signature [a] -> Number |
282 | 266 | * @signature String -> Number |
283 | - * @param array|string $list |
|
284 | 267 | * @return int |
285 | 268 | */ |
286 | 269 | function length() { |
@@ -304,8 +287,6 @@ discard block |
||
304 | 287 | * |
305 | 288 | * @stream |
306 | 289 | * @signature (a -> Boolean) -> [a] -> Boolean |
307 | - * @param callable $predicate |
|
308 | - * @param array $list |
|
309 | 290 | * @return bool |
310 | 291 | */ |
311 | 292 | function allSatisfies() { |
@@ -327,8 +308,6 @@ discard block |
||
327 | 308 | * |
328 | 309 | * @stream |
329 | 310 | * @signature (a -> Boolean) -> [a] -> Boolean |
330 | - * @param callable $predicate |
|
331 | - * @param array $list |
|
332 | 311 | * @return bool |
333 | 312 | */ |
334 | 313 | function anySatisfies() { |
@@ -350,8 +329,6 @@ discard block |
||
350 | 329 | * @stream |
351 | 330 | * @signature [*] -> [*] -> [*] |
352 | 331 | * @signature String -> String -> String |
353 | - * @param array $list1 |
|
354 | - * @param array $list2 |
|
355 | 332 | * @return array |
356 | 333 | */ |
357 | 334 | function concat() { |
@@ -376,7 +353,6 @@ discard block |
||
376 | 353 | * |
377 | 354 | * @stream |
378 | 355 | * @signature [[a]] -> [a] |
379 | - * @param array $lists |
|
380 | 356 | * @return array |
381 | 357 | */ |
382 | 358 | function concatAll() { |
@@ -404,9 +380,6 @@ discard block |
||
404 | 380 | * @stream |
405 | 381 | * @signature Number -> a -> [a] -> [a] |
406 | 382 | * @signature Number -> String -> String -> String |
407 | - * @param int $position |
|
408 | - * @param mixed $item |
|
409 | - * @param array $list |
|
410 | 383 | * @return array |
411 | 384 | */ |
412 | 385 | function insert() { |
@@ -434,9 +407,6 @@ discard block |
||
434 | 407 | * @stream |
435 | 408 | * @signature Number -> [a] -> [a] -> [a] |
436 | 409 | * @signature Number -> String -> String -> String |
437 | - * @param int $position |
|
438 | - * @param mixed $items |
|
439 | - * @param array $list |
|
440 | 410 | * @return array |
441 | 411 | */ |
442 | 412 | function insertAll() { |
@@ -465,8 +435,6 @@ discard block |
||
465 | 435 | * @stream |
466 | 436 | * @signature * -> [*] -> [*] |
467 | 437 | * @signature String -> String -> String |
468 | - * @param mixed $item |
|
469 | - * @param array $list |
|
470 | 438 | * @return array |
471 | 439 | */ |
472 | 440 | function append() { |
@@ -489,8 +457,6 @@ discard block |
||
489 | 457 | * @stream |
490 | 458 | * @signature a -> [a] -> [a] |
491 | 459 | * @signature String -> String -> String |
492 | - * @param mixed $item |
|
493 | - * @param array $list |
|
494 | 460 | * @return array |
495 | 461 | */ |
496 | 462 | function prepend() { |
@@ -513,8 +479,6 @@ discard block |
||
513 | 479 | * @stream |
514 | 480 | * @signature Number -> [a] -> [a] |
515 | 481 | * @signature Number -> String -> String |
516 | - * @param int $count |
|
517 | - * @param array $list |
|
518 | 482 | * @return array |
519 | 483 | */ |
520 | 484 | function take() { |
@@ -547,8 +511,6 @@ discard block |
||
547 | 511 | * |
548 | 512 | * @stream |
549 | 513 | * @signature (a -> Boolean) -> [a] -> [a] |
550 | - * @param callable $predicate |
|
551 | - * @param array $list |
|
552 | 514 | * @return array |
553 | 515 | */ |
554 | 516 | function takeWhile() { |
@@ -574,8 +536,6 @@ discard block |
||
574 | 536 | * |
575 | 537 | * @stream |
576 | 538 | * @signature (a -> Boolean) -> [a] -> [a] |
577 | - * @param callable $predicate |
|
578 | - * @param array $list |
|
579 | 539 | * @return array |
580 | 540 | */ |
581 | 541 | function takeLastWhile() { |
@@ -602,8 +562,6 @@ discard block |
||
602 | 562 | * |
603 | 563 | * @stream |
604 | 564 | * @signature (a -> Boolean) -> [a] -> [a] |
605 | - * @param callable $predicate |
|
606 | - * @param array $list |
|
607 | 565 | * @return array |
608 | 566 | */ |
609 | 567 | function takeUntil() { |
@@ -625,8 +583,6 @@ discard block |
||
625 | 583 | * |
626 | 584 | * @stream |
627 | 585 | * @signature (a -> Boolean) -> [a] -> [a] |
628 | - * @param callable $predicate |
|
629 | - * @param array $list |
|
630 | 586 | * @return array |
631 | 587 | */ |
632 | 588 | function takeLastUntil() { |
@@ -654,8 +610,6 @@ discard block |
||
654 | 610 | * @stream |
655 | 611 | * @signature Number -> [a] -> [a] |
656 | 612 | * @signature Number -> String -> String |
657 | - * @param int $count |
|
658 | - * @param array $list |
|
659 | 613 | * @return array |
660 | 614 | */ |
661 | 615 | function remove() { |
@@ -683,8 +637,6 @@ discard block |
||
683 | 637 | * |
684 | 638 | * @stream |
685 | 639 | * @signature (a -> Boolean) -> [a] -> [a] |
686 | - * @param callable $predicate |
|
687 | - * @param array $list |
|
688 | 640 | * @return array |
689 | 641 | */ |
690 | 642 | function removeWhile() { |
@@ -706,8 +658,6 @@ discard block |
||
706 | 658 | * |
707 | 659 | * @stream |
708 | 660 | * @signature (a -> Boolean) -> [a] -> [a] |
709 | - * @param callable $predicate |
|
710 | - * @param array $list |
|
711 | 661 | * @return array |
712 | 662 | */ |
713 | 663 | function removeLastWhile() { |
@@ -731,8 +681,6 @@ discard block |
||
731 | 681 | * |
732 | 682 | * @stream |
733 | 683 | * @signature (a -> Boolean) -> [a] -> [a] |
734 | - * @param callable $predicate |
|
735 | - * @param array $list |
|
736 | 684 | * @return array |
737 | 685 | */ |
738 | 686 | function removeUntil() { |
@@ -755,8 +703,6 @@ discard block |
||
755 | 703 | * |
756 | 704 | * @stream |
757 | 705 | * @signature (a -> Boolean) -> [a] -> [a] |
758 | - * @param callable $predicate |
|
759 | - * @param array $list |
|
760 | 706 | * @return array |
761 | 707 | */ |
762 | 708 | function removeLastUntil() { |
@@ -776,7 +722,6 @@ discard block |
||
776 | 722 | * |
777 | 723 | * @stream |
778 | 724 | * @signature [(k, v)] -> {k: v} |
779 | - * @param array $pairs |
|
780 | 725 | * @return stdClass |
781 | 726 | */ |
782 | 727 | function fromPairs() { |
@@ -805,8 +750,6 @@ discard block |
||
805 | 750 | * @stream |
806 | 751 | * @signature Number -> [a] -> [[a]] |
807 | 752 | * @signature Number -> String -> [String] |
808 | - * @param int $size |
|
809 | - * @param array $list |
|
810 | 753 | * @return array |
811 | 754 | */ |
812 | 755 | function slices() { |
@@ -834,8 +777,6 @@ discard block |
||
834 | 777 | * @stream |
835 | 778 | * @signature a -> [a] -> Boolean |
836 | 779 | * @signature String -> String -> Boolean |
837 | - * @param mixed $item |
|
838 | - * @param array|string $list |
|
839 | 780 | * @return bool |
840 | 781 | */ |
841 | 782 | function contains() { |
@@ -859,8 +800,6 @@ discard block |
||
859 | 800 | * @stream |
860 | 801 | * @signature (a -> Boolean) -> [a] -> Maybe(Number) |
861 | 802 | * @signature (v -> Boolean) -> {k: v} -> Maybe(k) |
862 | - * @param callable $predicate |
|
863 | - * @param array $list |
|
864 | 803 | * @return mixed |
865 | 804 | */ |
866 | 805 | function findIndex() { |
@@ -888,8 +827,6 @@ discard block |
||
888 | 827 | * @stream |
889 | 828 | * @signature (a -> Boolean) -> [a] -> Maybe(Number) |
890 | 829 | * @signature (v -> Boolean) -> {k: v} -> Maybe(k) |
891 | - * @param callable $predicate |
|
892 | - * @param array $list |
|
893 | 830 | * @return mixed |
894 | 831 | */ |
895 | 832 | function findLastIndex() { |
@@ -915,8 +852,6 @@ discard block |
||
915 | 852 | * |
916 | 853 | * @stream |
917 | 854 | * @signature (a -> Boolean) -> [a] -> Maybe(a) |
918 | - * @param callable $predicate |
|
919 | - * @param array $list |
|
920 | 855 | * @return mixed |
921 | 856 | */ |
922 | 857 | function find() { |
@@ -938,8 +873,6 @@ discard block |
||
938 | 873 | * |
939 | 874 | * @stream |
940 | 875 | * @signature (a -> Boolean) -> [a] -> Maybe(a) |
941 | - * @param callable $predicate |
|
942 | - * @param array $list |
|
943 | 876 | * @return mixed |
944 | 877 | */ |
945 | 878 | function findLast() { |
@@ -970,8 +903,6 @@ discard block |
||
970 | 903 | * @signature a -> [a] -> Number |
971 | 904 | * @signature v -> {k: v} -> Maybe(k) |
972 | 905 | * @signature String -> String -> Number |
973 | - * @param mixed $item |
|
974 | - * @param array $list |
|
975 | 906 | * @return int |
976 | 907 | */ |
977 | 908 | function indexOf() { |
@@ -1003,8 +934,6 @@ discard block |
||
1003 | 934 | * @stream |
1004 | 935 | * @signature a -> [a] -> Number |
1005 | 936 | * @signature String -> String -> Number |
1006 | - * @param mixed $item |
|
1007 | - * @param array $list |
|
1008 | 937 | * @return int |
1009 | 938 | */ |
1010 | 939 | function lastIndexOf() { |
@@ -1033,8 +962,6 @@ discard block |
||
1033 | 962 | * |
1034 | 963 | * @stream |
1035 | 964 | * @signature (a -> a -> Boolean) -> [a] -> [a] |
1036 | - * @param callable $areEqual |
|
1037 | - * @param array $list |
|
1038 | 965 | * @return array |
1039 | 966 | */ |
1040 | 967 | function uniqueBy() { |
@@ -1065,7 +992,6 @@ discard block |
||
1065 | 992 | * |
1066 | 993 | * @stream |
1067 | 994 | * @signature [a] -> [a] |
1068 | - * @param array $list |
|
1069 | 995 | * @return array |
1070 | 996 | */ |
1071 | 997 | function unique() { |
@@ -1098,8 +1024,6 @@ discard block |
||
1098 | 1024 | * |
1099 | 1025 | * @stream |
1100 | 1026 | * @signature (a -> String) -> [a] -> {String: a} |
1101 | - * @param callable $fn |
|
1102 | - * @param array $list |
|
1103 | 1027 | * @return array |
1104 | 1028 | */ |
1105 | 1029 | function groupBy() { |
@@ -1128,8 +1052,6 @@ discard block |
||
1128 | 1052 | * |
1129 | 1053 | * @stream |
1130 | 1054 | * @signature [a] -> [b] -> [[a,b]] |
1131 | - * @param array $list1 |
|
1132 | - * @param array $list2 |
|
1133 | 1055 | * @return array |
1134 | 1056 | */ |
1135 | 1057 | function pairsFrom() { |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | function filter() { |
68 | 68 | static $filter = false; |
69 | - $filter = $filter ?: curry(function($fn, $list){ |
|
69 | + $filter = $filter ?: curry(function($fn, $list) { |
|
70 | 70 | return array_values(array_filter($list, $fn)); |
71 | 71 | }); |
72 | 72 | return _apply($filter, func_get_args()); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | function reduce() { |
93 | 93 | static $reduce = false; |
94 | - $reduce = $reduce ?: curry(function($fn, $initial, $list){ |
|
94 | + $reduce = $reduce ?: curry(function($fn, $initial, $list) { |
|
95 | 95 | return array_reduce($list, $fn, $initial); |
96 | 96 | }); |
97 | 97 | return _apply($reduce, func_get_args()); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | */ |
119 | 119 | function each() { |
120 | 120 | static $each = false; |
121 | - $each = $each ?: curry(function($fn, $list){ |
|
121 | + $each = $each ?: curry(function($fn, $list) { |
|
122 | 122 | foreach ($list as $item) { |
123 | 123 | apply($fn, [$item]); |
124 | 124 | } |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | function head() { |
147 | 147 | static $head = false; |
148 | 148 | $head = $head ?: curry(function($list) { |
149 | - if(is_string($list)) |
|
149 | + if (is_string($list)) |
|
150 | 150 | return substr($list, 0, 1); |
151 | 151 | return (count($list) > 0) |
152 | 152 | ? $list[0] |
@@ -171,10 +171,10 @@ discard block |
||
171 | 171 | * @param array|string $list |
172 | 172 | * @return mixed |
173 | 173 | */ |
174 | -function last () { |
|
174 | +function last() { |
|
175 | 175 | static $last = false; |
176 | 176 | $last = $last ?: curry(function($list) { |
177 | - if(is_string($list)) |
|
177 | + if (is_string($list)) |
|
178 | 178 | return substr($list, -1); |
179 | 179 | return (count($list) > 0) |
180 | 180 | ? $list[count($list) - 1] |
@@ -200,10 +200,10 @@ discard block |
||
200 | 200 | * @param array|string $list |
201 | 201 | * @return array |
202 | 202 | */ |
203 | -function init () { |
|
203 | +function init() { |
|
204 | 204 | static $init = false; |
205 | 205 | $init = $init ?: curry(function($list) { |
206 | - if(is_string($list)) |
|
206 | + if (is_string($list)) |
|
207 | 207 | return (strlen($list) > 1) |
208 | 208 | ? substr($list, 0, strlen($list) - 1) |
209 | 209 | : ''; |
@@ -231,10 +231,10 @@ discard block |
||
231 | 231 | * @param array|string $list |
232 | 232 | * @return array |
233 | 233 | */ |
234 | -function tail () { |
|
234 | +function tail() { |
|
235 | 235 | static $tail = false; |
236 | 236 | $tail = $tail ?: curry(function($list) { |
237 | - if(is_string($list)) |
|
237 | + if (is_string($list)) |
|
238 | 238 | return (strlen($list) > 1) |
239 | 239 | ? substr($list, 1) |
240 | 240 | : ''; |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | * @param array|string $list |
260 | 260 | * @return array |
261 | 261 | */ |
262 | -function reverse () { |
|
262 | +function reverse() { |
|
263 | 263 | static $reverse = false; |
264 | 264 | $reverse = $reverse ?: curry(function($list) { |
265 | 265 | return is_string($list) |
@@ -382,8 +382,7 @@ discard block |
||
382 | 382 | function concatAll() { |
383 | 383 | static $concatAll = false; |
384 | 384 | $concatAll = $concatAll ?: curry(function($lists) { |
385 | - return length($lists) == 0 ? [] : |
|
386 | - reduce(concat(), head($lists), tail($lists)); |
|
385 | + return length($lists) == 0 ? [] : reduce(concat(), head($lists), tail($lists)); |
|
387 | 386 | }); |
388 | 387 | return _apply($concatAll, func_get_args()); |
389 | 388 | } |
@@ -471,7 +470,7 @@ discard block |
||
471 | 470 | */ |
472 | 471 | function append() { |
473 | 472 | static $append = false; |
474 | - $append = $append ?: curry(function ($item, $list) { |
|
473 | + $append = $append ?: curry(function($item, $list) { |
|
475 | 474 | return insert(length($list), $item, $list); |
476 | 475 | }); |
477 | 476 | return _apply($append, func_get_args()); |
@@ -523,7 +522,7 @@ discard block |
||
523 | 522 | $length = length($list); |
524 | 523 | if ($count > $length || $count < -$length) |
525 | 524 | return []; |
526 | - if(is_string($list)) { |
|
525 | + if (is_string($list)) { |
|
527 | 526 | return ($count >= 0) |
528 | 527 | ? substr($list, 0, $count) |
529 | 528 | : substr($list, $count); |
@@ -812,9 +811,9 @@ discard block |
||
812 | 811 | function slices() { |
813 | 812 | static $slices = false; |
814 | 813 | $slices = $slices ?: curry(function($size, $list) { |
815 | - if(empty($list)) |
|
814 | + if (empty($list)) |
|
816 | 815 | return is_string($list) ? '' : []; |
817 | - if(length($list) <= $size) |
|
816 | + if (length($list) <= $size) |
|
818 | 817 | return [$list]; |
819 | 818 | return prepend(take($size, $list), slices($size, remove($size, $list))); |
820 | 819 | }); |
@@ -841,7 +840,7 @@ discard block |
||
841 | 840 | function contains() { |
842 | 841 | static $contains = false; |
843 | 842 | $contains = $contains ?: curry(function($item, $list) { |
844 | - return -1 != indexOf($item, $list); |
|
843 | + return - 1 != indexOf($item, $list); |
|
845 | 844 | }); |
846 | 845 | return _apply($contains, func_get_args()); |
847 | 846 | } |
@@ -896,7 +895,7 @@ discard block |
||
896 | 895 | static $findLastIndex = false; |
897 | 896 | $findLastIndex = $findLastIndex ?: curry(function($predicate, $list) { |
898 | 897 | foreach (reverse(toPairs($list)) as $pair) { |
899 | - if($predicate($pair[1])) |
|
898 | + if ($predicate($pair[1])) |
|
900 | 899 | return $pair[0]; |
901 | 900 | } |
902 | 901 | return null; |
@@ -983,7 +982,7 @@ discard block |
||
983 | 982 | $index = findIndex(equals($item), $list); |
984 | 983 | } |
985 | 984 | return (false === $index || null === $index) |
986 | - ? -1 |
|
985 | + ? - 1 |
|
987 | 986 | : $index; |
988 | 987 | }); |
989 | 988 | return _apply($indexOf, func_get_args()); |
@@ -1016,7 +1015,7 @@ discard block |
||
1016 | 1015 | $index = findLastIndex(equals($item), $list); |
1017 | 1016 | } |
1018 | 1017 | return (false === $index || null === $index) |
1019 | - ? -1 |
|
1018 | + ? - 1 |
|
1020 | 1019 | : $index; |
1021 | 1020 | }); |
1022 | 1021 | return _apply($lastIndexOf, func_get_args()); |
@@ -1107,7 +1106,7 @@ discard block |
||
1107 | 1106 | $groupBy = $groupBy ?: curry(function($fn, $list) { |
1108 | 1107 | return reduce(function($result, $item) use($fn) { |
1109 | 1108 | $index = $fn($item); |
1110 | - if (! isset($result[$index])) |
|
1109 | + if (!isset($result[$index])) |
|
1111 | 1110 | $result[$index] = []; |
1112 | 1111 | $result[$index][] = $item; |
1113 | 1112 | return $result; |
@@ -14,8 +14,6 @@ discard block |
||
14 | 14 | * |
15 | 15 | * @stream |
16 | 16 | * @signature Number -> Number -> Number |
17 | - * @param int|float $x |
|
18 | - * @param int|float $y |
|
19 | 17 | * @return int|float |
20 | 18 | */ |
21 | 19 | function plus() { |
@@ -35,8 +33,6 @@ discard block |
||
35 | 33 | * |
36 | 34 | * @stream |
37 | 35 | * @signature Number -> Number -> Number |
38 | - * @param int|float $x |
|
39 | - * @param int|float $y |
|
40 | 36 | * @return int|float |
41 | 37 | */ |
42 | 38 | function minus() { |
@@ -57,7 +53,6 @@ discard block |
||
57 | 53 | * |
58 | 54 | * @stream |
59 | 55 | * @signature Number -> Number |
60 | - * @param int|float $x |
|
61 | 56 | * @return int|float |
62 | 57 | */ |
63 | 58 | function negate() { |
@@ -78,8 +73,6 @@ discard block |
||
78 | 73 | * |
79 | 74 | * @stream |
80 | 75 | * @signature Number -> Number -> Number |
81 | - * @param int|float $x |
|
82 | - * @param int|float $y |
|
83 | 76 | * @return int|float |
84 | 77 | */ |
85 | 78 | function multiply() { |
@@ -99,8 +92,6 @@ discard block |
||
99 | 92 | * |
100 | 93 | * @stream |
101 | 94 | * @signature Number -> Number -> Number |
102 | - * @param int|float $x |
|
103 | - * @param int|float $y |
|
104 | 95 | * @return int|float |
105 | 96 | */ |
106 | 97 | function divide() { |
@@ -120,8 +111,6 @@ discard block |
||
120 | 111 | * |
121 | 112 | * @stream |
122 | 113 | * @signature Number -> Number -> Number |
123 | - * @param int|float $x |
|
124 | - * @param int|float $y |
|
125 | 114 | * @return int|float |
126 | 115 | */ |
127 | 116 | function modulo() { |
@@ -142,7 +131,6 @@ discard block |
||
142 | 131 | * |
143 | 132 | * @stream |
144 | 133 | * @signature [Number] -> Number |
145 | - * @param array $numbers |
|
146 | 134 | * @return int|float |
147 | 135 | */ |
148 | 136 | function sum() { |
@@ -163,7 +151,6 @@ discard block |
||
163 | 151 | * |
164 | 152 | * @stream |
165 | 153 | * @signature [Number] -> Number |
166 | - * @param array $numbers |
|
167 | 154 | * @return int|float |
168 | 155 | */ |
169 | 156 | function product() { |
@@ -184,8 +171,6 @@ discard block |
||
184 | 171 | * |
185 | 172 | * @stream |
186 | 173 | * @signature Number -> Number -> Number |
187 | - * @param number $a |
|
188 | - * @param number $b |
|
189 | 174 | * @return number |
190 | 175 | */ |
191 | 176 | function min() { |
@@ -206,9 +191,6 @@ discard block |
||
206 | 191 | * |
207 | 192 | * @stream |
208 | 193 | * @signature (a -> Number) -> a -> a -> a |
209 | - * @param callable $fn |
|
210 | - * @param mixed $a |
|
211 | - * @param mixed $b |
|
212 | 194 | * @return mixed |
213 | 195 | */ |
214 | 196 | function minBy() { |
@@ -229,8 +211,6 @@ discard block |
||
229 | 211 | * |
230 | 212 | * @stream |
231 | 213 | * @signature Number -> Number -> Number |
232 | - * @param number $a |
|
233 | - * @param number $b |
|
234 | 214 | * @return number |
235 | 215 | */ |
236 | 216 | function max() { |
@@ -251,9 +231,6 @@ discard block |
||
251 | 231 | * |
252 | 232 | * @stream |
253 | 233 | * @signature (a -> Number) -> a -> a -> a |
254 | - * @param callable $fn |
|
255 | - * @param mixed $a |
|
256 | - * @param mixed $b |
|
257 | 234 | * @return mixed |
258 | 235 | */ |
259 | 236 | function maxBy() { |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | */ |
21 | 21 | function plus() { |
22 | 22 | static $plus = false; |
23 | - $plus = $plus ?: curry(function($x, $y){ |
|
23 | + $plus = $plus ?: curry(function($x, $y) { |
|
24 | 24 | return $x + $y; |
25 | 25 | }); |
26 | 26 | return _apply($plus, func_get_args()); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | function minus() { |
43 | 43 | static $minus = false; |
44 | - $minus = $minus ?: curry(function($x, $y){ |
|
44 | + $minus = $minus ?: curry(function($x, $y) { |
|
45 | 45 | return $x - $y; |
46 | 46 | }); |
47 | 47 | return _apply($minus, func_get_args()); |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | */ |
63 | 63 | function negate() { |
64 | 64 | static $negate = false; |
65 | - $negate = $negate ?: curry(function($x){ |
|
66 | - return -$x; |
|
65 | + $negate = $negate ?: curry(function($x) { |
|
66 | + return - $x; |
|
67 | 67 | }); |
68 | 68 | return _apply($negate, func_get_args()); |
69 | 69 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | function multiply() { |
86 | 86 | static $multiply = false; |
87 | - $multiply = $multiply ?: curry(function($x, $y){ |
|
87 | + $multiply = $multiply ?: curry(function($x, $y) { |
|
88 | 88 | return $y * $x; |
89 | 89 | }); |
90 | 90 | return _apply($multiply, func_get_args()); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | */ |
106 | 106 | function divide() { |
107 | 107 | static $divide = false; |
108 | - $divide = $divide ?: curry(function($x, $y){ |
|
108 | + $divide = $divide ?: curry(function($x, $y) { |
|
109 | 109 | return $x / $y; |
110 | 110 | }); |
111 | 111 | return _apply($divide, func_get_args()); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | function modulo() { |
128 | 128 | static $modulo = false; |
129 | - $modulo = $modulo ?: curry(function($x, $y){ |
|
129 | + $modulo = $modulo ?: curry(function($x, $y) { |
|
130 | 130 | return $x % $y; |
131 | 131 | }); |
132 | 132 | return _apply($modulo, func_get_args()); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | */ |
148 | 148 | function sum() { |
149 | 149 | static $sum = false; |
150 | - $sum = $sum ?: curry(function($numbers){ |
|
150 | + $sum = $sum ?: curry(function($numbers) { |
|
151 | 151 | return reduce(plus(), 0, $numbers); |
152 | 152 | }); |
153 | 153 | return _apply($sum, func_get_args()); |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | */ |
169 | 169 | function product() { |
170 | 170 | static $product = false; |
171 | - $product = $product ?: curry(function($numbers){ |
|
171 | + $product = $product ?: curry(function($numbers) { |
|
172 | 172 | return reduce(multiply(), 1, $numbers); |
173 | 173 | }); |
174 | 174 | return _apply($product, func_get_args()); |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | */ |
191 | 191 | function min() { |
192 | 192 | static $min = false; |
193 | - $min = $min ?: curry(function($a, $b){ |
|
193 | + $min = $min ?: curry(function($a, $b) { |
|
194 | 194 | return $a < $b ? $a : $b; |
195 | 195 | }); |
196 | 196 | return _apply($min, func_get_args()); |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | */ |
214 | 214 | function minBy() { |
215 | 215 | static $minBy = false; |
216 | - $minBy = $minBy ?: curry(function($fn, $a, $b){ |
|
216 | + $minBy = $minBy ?: curry(function($fn, $a, $b) { |
|
217 | 217 | return $fn($a) < $fn($b) ? $a : $b; |
218 | 218 | }); |
219 | 219 | return _apply($minBy, func_get_args()); |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | */ |
236 | 236 | function max() { |
237 | 237 | static $max = false; |
238 | - $max = $max ?: curry(function($a, $b){ |
|
238 | + $max = $max ?: curry(function($a, $b) { |
|
239 | 239 | return $a > $b ? $a : $b; |
240 | 240 | }); |
241 | 241 | return _apply($max, func_get_args()); |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | */ |
259 | 259 | function maxBy() { |
260 | 260 | static $maxBy = false; |
261 | - $maxBy = $maxBy ?: curry(function($fn, $a, $b){ |
|
261 | + $maxBy = $maxBy ?: curry(function($fn, $a, $b) { |
|
262 | 262 | return $fn($a) > $fn($b) ? $a : $b; |
263 | 263 | }); |
264 | 264 | return _apply($maxBy, func_get_args()); |
@@ -22,7 +22,6 @@ discard block |
||
22 | 22 | * ``` |
23 | 23 | * |
24 | 24 | * @signature a -> a |
25 | - * @param mixed $value |
|
26 | 25 | * @return mixed |
27 | 26 | */ |
28 | 27 | function clone_() { |
@@ -73,7 +72,6 @@ discard block |
||
73 | 72 | * |
74 | 73 | * @stream |
75 | 74 | * @signature {k: v} -> {k: v} |
76 | - * @param object|array $object |
|
77 | 75 | * @return array |
78 | 76 | */ |
79 | 77 | function attributes() { |
@@ -98,7 +96,6 @@ discard block |
||
98 | 96 | * @stream |
99 | 97 | * @signature [*] -> [Number] |
100 | 98 | * @signature {k: v} -> [k] |
101 | - * @param object|array $object |
|
102 | 99 | * @return array |
103 | 100 | */ |
104 | 101 | function keys() { |
@@ -121,7 +118,6 @@ discard block |
||
121 | 118 | * @stream |
122 | 119 | * @signature [a] -> [a] |
123 | 120 | * @signature {k: v} -> [v] |
124 | - * @param object|array $object |
|
125 | 121 | * @return array |
126 | 122 | */ |
127 | 123 | function values() { |
@@ -162,8 +158,6 @@ discard block |
||
162 | 158 | * |
163 | 159 | * @stream |
164 | 160 | * @signature k -> {k: v} -> Boolean |
165 | - * @param string|int $name |
|
166 | - * @param mixed $object |
|
167 | 161 | * @return bool |
168 | 162 | */ |
169 | 163 | function has() { |
@@ -195,8 +189,6 @@ discard block |
||
195 | 189 | * |
196 | 190 | * @stream |
197 | 191 | * @signature k -> {k: v} -> Maybe(v) |
198 | - * @param string $name |
|
199 | - * @param array $object |
|
200 | 192 | * @return mixed |
201 | 193 | */ |
202 | 194 | function get() { |
@@ -227,8 +219,6 @@ discard block |
||
227 | 219 | * |
228 | 220 | * @stream |
229 | 221 | * @signature [k] -> {k: v} -> v |
230 | - * @param array $path |
|
231 | - * @param mixed $object |
|
232 | 222 | * @return mixed |
233 | 223 | */ |
234 | 224 | function getPath() { |
@@ -259,9 +249,6 @@ discard block |
||
259 | 249 | * |
260 | 250 | * @stream |
261 | 251 | * @signature k -> v -> {k: v} -> {k: v} |
262 | - * @param string|int $name |
|
263 | - * @param mixed $value |
|
264 | - * @param mixed $object |
|
265 | 252 | * @return mixed |
266 | 253 | */ |
267 | 254 | function set() { |
@@ -293,9 +280,6 @@ discard block |
||
293 | 280 | * |
294 | 281 | * @stream |
295 | 282 | * @signature k -> (v -> v) -> {k: v} -> {k: v} |
296 | - * @param string|int $name |
|
297 | - * @param callable $fn |
|
298 | - * @param mixed $object |
|
299 | 283 | * @return mixed |
300 | 284 | */ |
301 | 285 | function update() { |
@@ -321,9 +305,6 @@ discard block |
||
321 | 305 | * |
322 | 306 | * @stream |
323 | 307 | * @signature (a -> Boolean) -> k -> {k : a} -> Boolean |
324 | - * @param callable $predicate |
|
325 | - * @param string|int $key |
|
326 | - * @param mixed $object |
|
327 | 308 | * @return bool |
328 | 309 | */ |
329 | 310 | function satisfies() { |
@@ -356,8 +337,6 @@ discard block |
||
356 | 337 | * |
357 | 338 | * @stream |
358 | 339 | * @signature {String: (a -> Boolean)} -> {k : a} -> Boolean |
359 | - * @param array $predicates |
|
360 | - * @param mixed $object |
|
361 | 340 | * @return bool |
362 | 341 | */ |
363 | 342 | function satisfiesAll() { |
@@ -394,8 +373,6 @@ discard block |
||
394 | 373 | * |
395 | 374 | * @stream |
396 | 375 | * @signature {String: (a -> Boolean)} -> {k : a} -> Boolean |
397 | - * @param array $predicates |
|
398 | - * @param mixed $object |
|
399 | 376 | * @return bool |
400 | 377 | */ |
401 | 378 | function satisfiesAny() { |
@@ -420,7 +397,6 @@ discard block |
||
420 | 397 | * |
421 | 398 | * @stream |
422 | 399 | * @signature {k: v} -> [(k,v)] |
423 | - * @param array $object |
|
424 | 400 | * @return array |
425 | 401 | */ |
426 | 402 | function toPairs() { |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | */ |
169 | 169 | function has() { |
170 | 170 | static $has = false; |
171 | - $has = $has ?: curry(function($name, $object){ |
|
171 | + $has = $has ?: curry(function($name, $object) { |
|
172 | 172 | return contains($name, keys($object)); |
173 | 173 | }); |
174 | 174 | return _apply($has, func_get_args()); |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | */ |
202 | 202 | function get() { |
203 | 203 | static $get = false; |
204 | - $get = $get ?: curry(function($name, $object){ |
|
204 | + $get = $get ?: curry(function($name, $object) { |
|
205 | 205 | $object = attributes($object); |
206 | 206 | return has($name, $object) |
207 | 207 | ? $object[$name] |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | */ |
234 | 234 | function getPath() { |
235 | 235 | static $getPath = false; |
236 | - $getPath = $getPath ?: curry(function($path, $object){ |
|
236 | + $getPath = $getPath ?: curry(function($path, $object) { |
|
237 | 237 | return reduce(function($result, $name) { |
238 | 238 | if ($result !== null) |
239 | 239 | $result = get($name, $result); |