We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c99ac1d commit 10aaf38Copy full SHA for 10aaf38
1 file changed
src/Comprehensions/Options/Option.php
@@ -72,12 +72,12 @@ public function each(callable $func)
72
}
73
74
/**
75
- * @param callable $func - A function that returns a boolean value when supplied with the value.
+ * @param callable $func - A function that returns a boolean when supplied with the value.
76
* @return Option
77
*/
78
public function filter(callable $func)
79
{
80
- return $this->isEmpty() ? new None() : new Some($func($this->get()));
+ return ($this->isEmpty()||$func($this->get())) ? $this : new None();
81
82
83
0 commit comments