Bkwld\Croppa\URL::options PHP Метод

options() публичный Метод

Create options array where each key is an option name and the value if an array of the passed arguments
public options ( string $option_params ) : array
$option_params string Options string in the Croppa URL style
Результат array
    public function options($option_params)
    {
        $options = array();
        // These will look like: "-quadrant(T)-resize"
        $option_params = explode('-', $option_params);
        // Loop through the params and make the options key value pairs
        foreach ($option_params as $option) {
            if (!preg_match('#(\\w+)(?:\\(([\\w,.]+)\\))?#i', $option, $matches)) {
                continue;
            }
            if (isset($matches[2])) {
                $options[$matches[1]] = explode(',', $matches[2]);
            } else {
                $options[$matches[1]] = null;
            }
        }
        // Map filter names to filter class instances or remove the config.
        $options['filters'] = $this->buildfilters($options);
        if (empty($options['filters'])) {
            unset($options['filters']);
        }
        // Return new options array
        return $options;
    }