src/main/php/Result.php
public function map(callable $mapper): self
    {
        if ($this->isPresent()) {
            return new self($mapper($this->value));
        }

        return self::$null;
    }
public function map(callable $mapper): self
    {
        if ($this->isPresent()) {
            return new self($mapper($this->value));
        }

        return self::$null;
    }
public function map ( callable $ mapper ) : self { if ( $ this -> isPresent ( ) ) { return new self ( $ mapper ( $ this -> value ) ) ; } return self :: $ null ; }
maps the value using mapper into a different result

In case the value is null the return value still is a null result.

@param   callable  $mapper
@return  \stubbles\values\Result
maps the value using mapper into a different result