Option::flatMap( callable $callable )

Applies the callable to the value of the option if it is non-empty, and returns the return value of the callable directly.


Description

In contrast to map, the return value of the callable is expected to be an Option itself; it is not automatically wrapped in Some().


Parameters

$callable

(Required) must return an Option


Return

(PhpOptionOption)


Source

File: vendor/phpoption/phpoption/src/PhpOption/Option.php

    abstract public function flatMap($callable);