Skip to content

Commit

Permalink
Merge pull request ILIAS-eLearning#20 from shecken/trunk_result
Browse files Browse the repository at this point in the history
Small fixes in exception implementation, readme and docstring
  • Loading branch information
klees authored Apr 20, 2017
2 parents f66108b + 3853d2d commit 36dfcd8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Data/NotOKException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
/**
* Signals that a result contains no value.
*/
class NotOKException {
class NotOKException extends Exception{
}
2 changes: 1 addition & 1 deletion src/Data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
4 changes: 2 additions & 2 deletions src/Data/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -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.
*
Expand Down

0 comments on commit 36dfcd8

Please sign in to comment.