Skip to content

Commit f2d9dbb

Browse files
committed
chore(_collection): add docblocks
1 parent c825515 commit f2d9dbb

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

src/UnderscoreCollection.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ public function map(callable $fn)
4040

4141
/**
4242
* Alias of map().
43+
*
44+
* @param callable $fn The callback.
45+
*
46+
* @return self
4347
*/
4448
public function collect(callable $fn)
4549
{
@@ -61,6 +65,11 @@ public function reduce(callable $fn, $memo)
6165

6266
/**
6367
* Alias of reduce().
68+
*
69+
* @param callable $fn The callback.
70+
* @param mixed $memo The initial value carried over to each iteration and returned finally.
71+
*
72+
* @return mixed
6473
*/
6574
public function foldl(callable $fn, $memo)
6675
{
@@ -69,6 +78,11 @@ public function foldl(callable $fn, $memo)
6978

7079
/**
7180
* Alias of reduce().
81+
*
82+
* @param callable $fn The callback.
83+
* @param mixed $memo The initial value carried over to each iteration and returned finally.
84+
*
85+
* @return mixed
7286
*/
7387
public function inject(callable $fn, $memo)
7488
{
@@ -90,6 +104,11 @@ public function reduceRight(callable $fn, $memo)
90104

91105
/**
92106
* Alias of reduceRight().
107+
*
108+
* @param callable $fn The callback.
109+
* @param mixed $memo The initial value carried over to each iteration and returned finally.
110+
*
111+
* @return mixed
93112
*/
94113
public function foldr(callable $fn, $memo)
95114
{
@@ -115,6 +134,11 @@ public function find(callable $fn, $useValue = true)
115134

116135
/**
117136
* Alias of find().
137+
*
138+
* @param callable $fn The truth test callback.
139+
* @param bool $useValue Whether to return value or the index on match.
140+
*
141+
* @return mixed|null
118142
*/
119143
public function detect(callable $fn)
120144
{
@@ -141,6 +165,10 @@ public function filter($fn = null)
141165

142166
/**
143167
* Alias of filter().
168+
*
169+
* @param callable|string|null $fn The truth test callback.
170+
*
171+
* @return self
144172
*/
145173
public function select(callable $fn = null)
146174
{
@@ -175,6 +203,10 @@ public function every(callable $fn)
175203

176204
/**
177205
* Alias of every().
206+
*
207+
* @param callable $fn The truth test callback.
208+
*
209+
* @return bool
178210
*/
179211
public function all(callable $fn)
180212
{
@@ -195,6 +227,10 @@ public function some(callable $fn)
195227

196228
/**
197229
* Alias of some().
230+
*
231+
* @param callable $fn The truth test callback.
232+
*
233+
* @return bool
198234
*/
199235
public function any(callable $fn)
200236
{

0 commit comments

Comments
 (0)