File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ interface Result
1616 * 結果が成功(Ok)の場合に true を返します.
1717 *
1818 * @phpstan-assert-if-true Ok<T> $this
19+ * @phpstan-assert-if-false Err<E> $this
1920 *
2021 * @return bool
2122 */
@@ -34,6 +35,7 @@ public function isOkAnd(callable $fn): bool;
3435 * 結果が失敗(Err)の場合に true を返します.
3536 *
3637 * @phpstan-assert-if-true Err<E> $this
38+ * @phpstan-assert-if-false Ok<T> $this
3739 *
3840 * @return bool
3941 */
@@ -51,14 +53,14 @@ public function isErrAnd(callable $fn): bool;
5153 /**
5254 * 成功値を返します。失敗の場合は例外を投げます.
5355 *
54- * @return T
56+ * @return ($this is Ok<T> ? T : never)
5557 */
5658 public function unwrap (): mixed ;
5759
5860 /**
5961 * エラー値を返します。成功の場合は例外を投げます.
6062 *
61- * @return E
63+ * @return ($this is Err<E> ? E : never)
6264 */
6365 public function unwrapErr (): mixed ;
6466
@@ -67,7 +69,7 @@ public function unwrapErr(): mixed;
6769 *
6870 * @template U
6971 * @param U $default
70- * @return T|U
72+ * @return ($this is Ok<T> ? T : U)
7173 */
7274 public function unwrapOr (mixed $ default ): mixed ;
7375
You can’t perform that action at this time.
0 commit comments