Skip to content

Commit 4102ed1

Browse files
committed
Update AbstractOption.php
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
1 parent 570c9b2 commit 4102ed1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/AbstractOption.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ public function expect(Throwable $throwable): mixed
7474

7575
public function filter(callable $function): OptionInterface
7676
{
77-
return $this->andThen(
77+
return $this->map(
7878
/** @param TValue $value */
7979
fn (mixed $value): OptionInterface => $function($value) ? $this : None::create()
8080
);
8181
}
8282

8383
public function flatten(): OptionInterface
8484
{
85-
return $this->andThen(fn (mixed $value) => $value instanceof SomeInterface ? $value : $this);
85+
return $this->map(fn (mixed $value) => $value instanceof SomeInterface ? $value : $this);
8686
}
8787

8888
public function getIterator(): Traversable

0 commit comments

Comments
 (0)