File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ [tools ]
2+ php = " 8.5"
Original file line number Diff line number Diff line change 66
77use Closure ;
88use EmptyIterator ;
9+ use NoDiscard ;
910use Override ;
1011use RuntimeException ;
1112use Throwable ;
@@ -78,12 +79,14 @@ public function unwrap(): never
7879 $ this ->expect ('Unwrapping a `None` value ' );
7980 }
8081
82+ #[NoDiscard]
8183 #[Override]
8284 public function unwrapOr (mixed $ default ): mixed
8385 {
8486 return $ default ;
8587 }
8688
89+ #[NoDiscard]
8790 #[Override]
8891 public function unwrapOrElse (Closure $ default ): mixed
8992 {
Original file line number Diff line number Diff line change 55namespace WizDevelop \PhpMonad \Option ;
66
77use Closure ;
8+ use NoDiscard ;
89use Override ;
910use Throwable ;
1011use Traversable ;
@@ -80,6 +81,7 @@ public function expect(string $message): mixed
8081 /**
8182 * @throws void
8283 */
84+ #[NoDiscard]
8385 #[Override]
8486 public function unwrap (): mixed
8587 {
@@ -89,6 +91,7 @@ public function unwrap(): mixed
8991 /**
9092 * @return T
9193 */
94+ #[NoDiscard]
9295 #[Override]
9396 public function unwrapOr (mixed $ default ): mixed
9497 {
@@ -98,6 +101,7 @@ public function unwrapOr(mixed $default): mixed
98101 /**
99102 * @return T
100103 */
104+ #[NoDiscard]
101105 #[Override]
102106 public function unwrapOrElse (Closure $ default ): mixed
103107 {
@@ -110,6 +114,7 @@ public function unwrapOrElse(Closure $default): mixed
110114 * @return T
111115 * @throws never
112116 */
117+ #[NoDiscard]
113118 #[Override]
114119 public function unwrapOrThrow (Throwable $ exception ): mixed
115120 {
Original file line number Diff line number Diff line change 66
77use Closure ;
88use EmptyIterator ;
9+ use NoDiscard ;
910use Override ;
1011use RuntimeException ;
1112use Throwable ;
@@ -103,6 +104,7 @@ public function unwrap(): never
103104 /**
104105 * @return E
105106 */
107+ #[NoDiscard]
106108 #[Override]
107109 public function unwrapErr (): mixed
108110 {
@@ -114,6 +116,7 @@ public function unwrapErr(): mixed
114116 * @param U $default
115117 * @return U
116118 */
119+ #[NoDiscard]
117120 #[Override]
118121 public function unwrapOr (mixed $ default ): mixed
119122 {
@@ -125,6 +128,7 @@ public function unwrapOr(mixed $default): mixed
125128 * @param Closure(E): U $default
126129 * @return U
127130 */
131+ #[NoDiscard]
128132 #[Override]
129133 public function unwrapOrElse (Closure $ default ): mixed
130134 {
Original file line number Diff line number Diff line change 55namespace WizDevelop \PhpMonad \Result ;
66
77use Closure ;
8+ use NoDiscard ;
89use Override ;
910use RuntimeException ;
1011use Throwable ;
@@ -92,6 +93,7 @@ public function expect(string $message): mixed
9293 /**
9394 * @return T
9495 */
96+ #[NoDiscard]
9597 #[Override]
9698 public function unwrap (): mixed
9799 {
@@ -107,12 +109,14 @@ public function unwrapErr(): never
107109 throw new RuntimeException (sprintf ('Unwrapping err on `Ok`: %s ' , serialize ($ this ->value )));
108110 }
109111
112+ #[NoDiscard]
110113 #[Override]
111114 public function unwrapOr (mixed $ default ): mixed
112115 {
113116 return $ this ->value ;
114117 }
115118
119+ #[NoDiscard]
116120 #[Override]
117121 public function unwrapOrElse (Closure $ default ): mixed
118122 {
@@ -125,6 +129,7 @@ public function unwrapOrElse(Closure $default): mixed
125129 * @return T
126130 * @throws never
127131 */
132+ #[NoDiscard]
128133 #[Override]
129134 public function unwrapOrThrow (Throwable $ exception ): mixed
130135 {
Original file line number Diff line number Diff line change 1515
1616#[TestDox('Option - OrThrow メソッドのテスト ' )]
1717#[CoversClass(Option::class)]
18- #[CoversClass(Option \Some::class)]
19- #[CoversClass(Option \None::class)]
2018final class OrThrowTest extends TestCase
2119{
2220 #[Test]
Original file line number Diff line number Diff line change 1515
1616#[TestDox('Result - OrThrow メソッドのテスト ' )]
1717#[CoversClass(Result::class)]
18- #[CoversClass(Result \Ok::class)]
19- #[CoversClass(Result \Err::class)]
2018final class OrThrowTest extends TestCase
2119{
2220 #[Test]
You can’t perform that action at this time.
0 commit comments