Locker\Data\Analytics\Analytics::getOption PHP Method

getOption() private method

Gets a option from options.
private getOption ( array $options, String $key, Mixed $default = null, callable $modifier = null ) : MongoDate
$options array
$key String Name of the option.
$default Mixed Default value if option isn't defined. Defaults to null.
$modifier callable A function to modify the option value if defined. Defaults to null.
return MongoDate
    private function getOption(array $options, $key, $default = null, callable $modifier = null)
    {
        $modifier = $modifier !== null ? $modifier : function ($val) {
            return $val;
        };
        return isset($options[$key]) ? $modifier($options[$key]) : $default;
    }