We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 570c9b2 commit 4102ed1Copy full SHA for 4102ed1
src/AbstractOption.php
@@ -74,15 +74,15 @@ public function expect(Throwable $throwable): mixed
74
75
public function filter(callable $function): OptionInterface
76
{
77
- return $this->andThen(
+ return $this->map(
78
/** @param TValue $value */
79
fn (mixed $value): OptionInterface => $function($value) ? $this : None::create()
80
);
81
}
82
83
public function flatten(): OptionInterface
84
85
- return $this->andThen(fn (mixed $value) => $value instanceof SomeInterface ? $value : $this);
+ return $this->map(fn (mixed $value) => $value instanceof SomeInterface ? $value : $this);
86
87
88
public function getIterator(): Traversable
0 commit comments