/** * @param callable $callback * * @return Optional */ public function ensure(callable $callback) : Optional { if ($callback($this->value)) { return $this; } return None::Instance(); }
/** * @return None */ function none() : None { return None::Instance(); }