diff --git a/src/Data/NotOKException.php b/src/Data/NotOKException.php index bc37359dfebb..ce68dc6e0aba 100644 --- a/src/Data/NotOKException.php +++ b/src/Data/NotOKException.php @@ -6,5 +6,5 @@ /** * Signals that a result contains no value. */ -class NotOKException { +class NotOKException extends Exception{ } diff --git a/src/Data/README.md b/src/Data/README.md index f4651bf8e48a..3dfa3e4e71f4 100644 --- a/src/Data/README.md +++ b/src/Data/README.md @@ -35,7 +35,7 @@ assert(!$pi->isError()); // Do some transformation with the value. $r = 10; -$A = $f->map(function($value_of_pi) use ($r) { return 2 * $value_of_pi * $r; }); +$A = $pi->map(function($value_of_pi) use ($r) { return 2 * $value_of_pi * $r; }); // Still ok and no error. assert($A->isOk()); diff --git a/src/Data/Result.php b/src/Data/Result.php index b9a60e03a04b..21a487d59f0b 100644 --- a/src/Data/Result.php +++ b/src/Data/Result.php @@ -61,7 +61,7 @@ public function map(callable $f); /** * Get a new result from the callable or do nothing if this is an error. * - * If null is returned the result is not touched. + * If null is returned from $f, the result is not touched. * * Does nothing if !isOK. This is monadic bind. * @@ -74,7 +74,7 @@ public function then(callable $f); * Feed the error into a callable and replace this with the result * or do nothing if this is a value. * - * If null is returned, the error in the result is not touched. + * If null is returned from $f, the error in the result is not touched. * * Does nothing if !isError. *