public static function fromValue($value, $noneValue = null)
    {
        if ($value === $noneValue) {
            return None::create();
        }

        return new Some($value);
    }
public static function fromValue($value, $noneValue = null)
    {
        if ($value === $noneValue) {
            return None::create();
        }

        return new Some($value);
    }
public static function fromValue ( $ value , $ noneValue = null ) { if ( $ value === $ noneValue ) { return None :: create ( ) ; } return new Some ( $ value ) ; }
Creates an option given a return value.

This is intended for consuming existing APIs and allows you to easily
convert them to an option. By default, we treat ``null`` as the None case,
and everything else as Some.

@param mixed $value The actual return value.
@param mixed $noneValue The value which should be considered "None"; null
by default.

@return Option
Creates an option given a return value .