Skip to content

Adds note about LazyAttempt method chaining #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/PhpTry/Attempt.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ abstract public function toOption();
* Like `map`, but without caring about the return value of the callable.
* Useful for consuming the possible value of the Attempt.
*
* @param callable $callable Callable returning a value.
*
* @return Attempt The current Attempt
*/
abstract public function forAll($callable);
Expand All @@ -224,6 +226,9 @@ public static function call($callable, $arguments = array())
*
* The callable will only be called if a method on the Attempt is called.
*
* @note Chaining should work as desired, but note that LazyAttempt methods do not return $this, but rather
* return an internal Attempt object.
*
* @param callable $callable
* @param array $arguments Optional arguments for the callable.
*
Expand Down
3 changes: 3 additions & 0 deletions src/PhpTry/LazyAttempt.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

/**
* Attempt that is evaluated on first access.
*
* @note Chaining should work as desired, but note that LazyAttempt methods do not return $this, but rather
* return an internal Attempt object.
*/
class LazyAttempt extends Attempt
{
Expand Down