Some::flatMap( $callable )


Source

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

    public function flatMap($callable)
    {
        $rs = call_user_func($callable, $this->value);
        if ( ! $rs instanceof Option) {
            throw new \RuntimeException('Callables passed to flatMap() must return an Option. Maybe you should use map() instead?');
        }

        return $rs;
    }