Skip to content

Commit

Permalink
Update invoke_first & invoke_last documentation. (#207)
Browse files Browse the repository at this point in the history
* Update `invoke_first` & `invoke_last` documentation.

Closes #156.

* Fix coding style errors so build succeeds.
  • Loading branch information
jasonmm authored and lstrojny committed Dec 19, 2019
1 parent bf439a9 commit df0e516
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/functional-php.md
Original file line number Diff line number Diff line change
Expand Up @@ -570,10 +570,10 @@ $userId = invoke_if($user, 'getId', [], 0);
Invokes method `$methodName` on each object in the `$collection` and returns the results of the call

``mixed Functional\invoke_first(array|Traversable $collection, string $methodName[, array $methodArguments])``
Invokes method `$methodName` on the first object in the `$collection` and returns the results of the call
Invokes method `$methodName` on the first object in the `$collection` containing a callable method named `$methodName` and returns the results of the call

``mixed Functional\invoke_last(array|Traversable $collection, string $methodName[, array $methodArguments])``
Invokes method `$methodName` on the last object in the `$collection` and returns the results of the call
Invokes method `$methodName` on the last object in the `$collection` containing a callable method named `$methodName` and returns the results of the call


## invoker()
Expand Down
5 changes: 3 additions & 2 deletions src/Functional/InvokeFirst.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
use Traversable;

/**
* Calls the method named by $methodName on first value in the collection. Any extra arguments passed to invoke will be
* forwarded on to the method invocation.
* Calls the method named by $methodName on first object in the collection containing a callable method named
* $methodName. Any extra arguments passed to invoke will be forwarded on to the method invocation.
*
* @param Traversable|array $collection
* @param string $methodName
* @param array $arguments
*
* @return mixed
*/
function invoke_first($collection, $methodName, array $arguments = [])
Expand Down
4 changes: 2 additions & 2 deletions src/Functional/InvokeLast.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
use Functional\Exceptions\InvalidArgumentException;

/**
* Calls the method named by $methodName on last value in the collection. Any extra arguments passed to invoke will be
* forwarded on to the method invocation.
* Calls the method named by $methodName on last object in the collection containing a callable method named
* $methodName. Any extra arguments passed to invoke will be forwarded on to the method invocation.
*
* @param Traversable|array $collection
* @param string $methodName
Expand Down
2 changes: 2 additions & 0 deletions src/Functional/Noop.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Copyright (C) 2011-2017 by Lars Strojny <[email protected]>
*
Expand All @@ -20,6 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

namespace Functional;

/**
Expand Down

0 comments on commit df0e516

Please sign in to comment.