Skip to content

Commit ce7daf7

Browse files
committed
fix: Option/functions.php の PHPDoc を修正(ただしく型推論されるように)
Fixes #45
1 parent e52ac1d commit ce7daf7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Option/functions.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ function none(): Option\None
3636
* It will be a `Some` option containing `$value` if `$value` is different from `$noneValue` (default `null`)
3737
*
3838
* @template U
39-
* @param U $value
39+
* @param U|null $value
4040
* @return Option<U>
4141
*/
42-
function fromValue(mixed $value, mixed $noneValue = null, bool $strict = true): Option
42+
function fromValue($value, mixed $noneValue = null, bool $strict = true): Option
4343
{
4444
$same = $strict
4545
? ($value === $noneValue)
@@ -55,7 +55,7 @@ function fromValue(mixed $value, mixed $noneValue = null, bool $strict = true):
5555
* It will be a `Some` option containing the result if it is different from `$noneValue` (default `null`).
5656
*
5757
* @template U
58-
* @param callable():U $callback
58+
* @param callable():U|null $callback
5959
* @return Option<U>
6060
*/
6161
function of(callable $callback, mixed $noneValue = null, bool $strict = true): Option
@@ -69,7 +69,7 @@ function of(callable $callback, mixed $noneValue = null, bool $strict = true): O
6969
*
7070
* @template U
7171
* @template E of \Throwable
72-
* @param callable():U $callback
72+
* @param callable():U|null $callback
7373
* @param class-string<E> $exceptionClass
7474
* @return Option<U>
7575
* @throws Throwable

0 commit comments

Comments
 (0)