src/Helper.php
public static function transform($value, callable $callback, $default = null)
    {
        if (self::filled($value)) {
            return $callback($value);
        }

        if (\is_callable($default)) {
            return $default($value);
        }

        return $default;
    }
public static function transform($value, callable $callback, $default = null)
    {
        if (self::filled($value)) {
            return $callback($value);
        }

        if (\is_callable($default)) {
            return $default($value);
        }

        return $default;
    }
public static function transform ( $ value , callable $ callback , $ default = null ) { if ( self :: filled ( $ value ) ) { return $ callback ( $ value ) ; } if ( \ is_callable ( $ default ) ) { return $ default ( $ value ) ; } return $ default ; }
Transform the given value if it is present.

@param  mixed  $value
@param  callable  $callback
@param  mixed  $default
@return mixed|null
Transform the given value if it is present .