Option::map( callable $callable )

Applies the callable to the value of the option if it is non-empty, and returns the return value of the callable wrapped in Some().


Description

If the option is empty, then the callable is not applied.

    (new Some("foo"))->map('strtoupper')->get(); // "FOO"

Parameters

$callable

(Required)


Return

(PhpOptionOption)


Source

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

    abstract public function map($callable);