Skip to content

Commit

Permalink
fix(option): return Option<never> for Option::none() (#415)
Browse files Browse the repository at this point in the history
  • Loading branch information
devnix authored Jul 18, 2023
1 parent 1d015ad commit 741bfa5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/component/option.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#### `Functions`

- [from_nullable](./../../src/Psl/Option/from_nullable.php#L16)
- [none](./../../src/Psl/Option/none.php#L14)
- [none](./../../src/Psl/Option/none.php#L12)
- [some](./../../src/Psl/Option/some.php#L16)

#### `Classes`
Expand Down
5 changes: 2 additions & 3 deletions src/Psl/Option/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@ public static function some(mixed $value): Option
/**
* Create an option with none value.
*
* @template Tn
*
* @return Option<Tn>
* @return Option<never>
*/
public static function none(): Option
{
/** @var Option<never> */
return new self(null);
}

Expand Down
4 changes: 1 addition & 3 deletions src/Psl/Option/none.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
/**
* Create an option with none value.
*
* @template T
*
* @return Option<T>
* @return Option<never>
*/
function none(): Option
{
Expand Down

0 comments on commit 741bfa5

Please sign in to comment.