Skip to content

Commit

Permalink
[6.x] Docblock tweaks for Enumerable and friends (laravel#30130)
Browse files Browse the repository at this point in the history
* Triple space fix in docblock params

* Replace 'test' with 'truth test'

Everywhere else in `Enumerable` and `EnumeratesValues`, predicate
expressions not subsumed under ‘callback’ are called ‘truth tests’.

Motivation is ubiquitous language

* Update 'diff using' function docs in Enumerables

The `diffUsing` docblock on `Enumerable` already indicates the callback
is used [for comparison].

The motivation for adding this clarity to the other ‘diff using’
function docs is:

1) to make it a little more difficult for someone looking at the diff
functions to get confused

2) to align the docblocks on all these functions with the arguably
better precedent set by `diffUsing` on `Enumerable`

Also do the triple-space docblock param fix in `Enumerable` that I
missed
  • Loading branch information
yakryder authored and i-bajrai committed Oct 4, 2019
1 parent e847485 commit a67546e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/Illuminate/Support/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public function diff($items)
}

/**
* Get the items in the collection that are not present in the given items.
* Get the items in the collection that are not present in the given items, using the callback.
*
* @param mixed $items
* @param callable $callback
Expand All @@ -231,7 +231,7 @@ public function diffAssoc($items)
}

/**
* Get the items in the collection whose keys and values are not present in the given items.
* Get the items in the collection whose keys and values are not present in the given items, using the callback.
*
* @param mixed $items
* @param callable $callback
Expand All @@ -254,9 +254,9 @@ public function diffKeys($items)
}

/**
* Get the items in the collection whose keys are not present in the given items.
* Get the items in the collection whose keys are not present in the given items, using the callback.
*
* @param mixed $items
* @param mixed $items
* @param callable $callback
* @return static
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Illuminate/Support/Enumerable.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public function diffUsing($items, callable $callback);
public function diffAssoc($items);

/**
* Get the items whose keys and values are not present in the given items.
* Get the items whose keys and values are not present in the given items, using the callback.
*
* @param mixed $items
* @param callable $callback
Expand All @@ -176,9 +176,9 @@ public function diffAssocUsing($items, callable $callback);
public function diffKeys($items);

/**
* Get the items whose keys are not present in the given items.
* Get the items whose keys are not present in the given items, using the callback.
*
* @param mixed $items
* @param mixed $items
* @param callable $callback
* @return static
*/
Expand Down Expand Up @@ -218,7 +218,7 @@ public function each(callable $callback);
public function eachSpread(callable $callback);

/**
* Determine if all items pass the given test.
* Determine if all items pass the given truth test.
*
* @param string|callable $key
* @param mixed $operator
Expand Down
6 changes: 3 additions & 3 deletions src/Illuminate/Support/LazyCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public function diffAssoc($items)
}

/**
* Get the items whose keys and values are not present in the given items.
* Get the items whose keys and values are not present in the given items, using the callback.
*
* @param mixed $items
* @param callable $callback
Expand All @@ -260,9 +260,9 @@ public function diffKeys($items)
}

/**
* Get the items whose keys are not present in the given items.
* Get the items whose keys are not present in the given items, using the callback.
*
* @param mixed $items
* @param mixed $items
* @param callable $callback
* @return static
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Support/Traits/EnumeratesValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public function eachSpread(callable $callback)
}

/**
* Determine if all items pass the given test.
* Determine if all items pass the given truth test.
*
* @param string|callable $key
* @param mixed $operator
Expand Down

0 comments on commit a67546e

Please sign in to comment.