Skip to content

Commit df0e516

Browse files
jasonmmlstrojny
authored andcommitted
Update invoke_first & invoke_last documentation. (#207)
* Update `invoke_first` & `invoke_last` documentation. Closes #156. * Fix coding style errors so build succeeds.
1 parent bf439a9 commit df0e516

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

docs/functional-php.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,10 +570,10 @@ $userId = invoke_if($user, 'getId', [], 0);
570570
Invokes method `$methodName` on each object in the `$collection` and returns the results of the call
571571

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

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

578578

579579
## invoker()

src/Functional/InvokeFirst.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414
use Traversable;
1515

1616
/**
17-
* Calls the method named by $methodName on first value in the collection. Any extra arguments passed to invoke will be
18-
* forwarded on to the method invocation.
17+
* Calls the method named by $methodName on first object in the collection containing a callable method named
18+
* $methodName. Any extra arguments passed to invoke will be forwarded on to the method invocation.
1919
*
2020
* @param Traversable|array $collection
2121
* @param string $methodName
2222
* @param array $arguments
23+
*
2324
* @return mixed
2425
*/
2526
function invoke_first($collection, $methodName, array $arguments = [])

src/Functional/InvokeLast.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
use Functional\Exceptions\InvalidArgumentException;
1515

1616
/**
17-
* Calls the method named by $methodName on last value in the collection. Any extra arguments passed to invoke will be
18-
* forwarded on to the method invocation.
17+
* Calls the method named by $methodName on last object in the collection containing a callable method named
18+
* $methodName. Any extra arguments passed to invoke will be forwarded on to the method invocation.
1919
*
2020
* @param Traversable|array $collection
2121
* @param string $methodName

src/Functional/Noop.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* Copyright (C) 2011-2017 by Lars Strojny <lstrojny@php.net>
45
*
@@ -20,6 +21,7 @@
2021
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2122
* THE SOFTWARE.
2223
*/
24+
2325
namespace Functional;
2426

2527
/**

0 commit comments

Comments
 (0)