Skip to content

Commit

Permalink
Fix some dox
Browse files Browse the repository at this point in the history
  • Loading branch information
prewk committed Mar 19, 2018
1 parent 9e550a1 commit 990694d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
11 changes: 7 additions & 4 deletions src/Option.php
Expand Up @@ -16,8 +16,10 @@
use Traversable;

/**
* Describes an optional value
*
* @template T
* Describes a Option
* The optional value
*/
abstract class Option
{
Expand Down Expand Up @@ -58,7 +60,6 @@ abstract public function unwrap();
* Unwraps a result, yielding the content of a Some. Else, it returns optb.
*
* @param mixed $optb
* @psalm-param T $optb
* @return mixed
* @psalm-return T|mixed
*/
Expand Down Expand Up @@ -103,15 +104,17 @@ abstract public function mapOrElse(Closure $default, Closure $mapper);
* Transforms the Option<T> into a Result<T, E>, mapping Some(v) to Ok(v) and None to Err(err).
*
* @param mixed $err
* @return Result<T, mixed>
* @return Result
* @psalm-return Result<T, mixed>
*/
abstract public function okOr($err): Result;

/**
* Transforms the Option<T> into a Result<T, E>, mapping Some(v) to Ok(v) and None to Err(err()).
*
* @param Closure $err
* @return Result<T, mixed>
* @return Result
* @psalm-return Result<T, mixed>
*/
abstract public function okOrElse(Closure $err): Result;

Expand Down
4 changes: 3 additions & 1 deletion src/Option/None.php
Expand Up @@ -17,8 +17,10 @@
use Prewk\Result\Err;

/**
* No value
*
* @template T
* None
* The optional value
*
* @inherits Option<T>
*/
Expand Down
4 changes: 3 additions & 1 deletion src/Option/Some.php
Expand Up @@ -17,8 +17,10 @@
use Prewk\Result\Ok;

/**
* Some value
*
* @template T
* Some
* The optional value
*
* @inherits Option<T>
*/
Expand Down

0 comments on commit 990694d

Please sign in to comment.