Devise\Pages\Interpreter\DeviseTag::extractParametersFromUnparsedStr PHP Method

extractParametersFromUnparsedStr() protected method

Extracts out the parameters from an unparsed devise string
protected extractParametersFromUnparsedStr ( $params ) : void
return void
    protected function extractParametersFromUnparsedStr($params)
    {
        $params = ltrim($params);
        $params = str_replace('data-devise=', '', $params);
        $params = substr($params, 1);
        $params = substr($params, 0, -1);
        $params = str_getcsv($params);
        // trim away extra white space off each value
        array_walk($params, function (&$value) {
            $value = ltrim(rtrim($value));
        });
        if (!isset($params[0])) {
            throw new InvalidDeviseKeyException('Cannot have an empty key');
        }
        // below we list out all the params and defaults too
        list($collection, $key) = $this->extractKeyAndCollection($params[0]);
        $this->id = $params[0];
        $this->collection = $collection ?: null;
        $this->bindingType = $this->extractBindingType($collection, $key);
        $this->key = $key;
        $this->type = isset($params[1]) ? $params[1] : null;
        $this->humanName = isset($params[2]) && $params[2] !== 'null' && $params[2] ? $params[2] : $this->humanize($key);
        $this->collectionName = null;
        $this->group = isset($params[3]) && $params[3] !== 'null' && $params[3] ? $params[3] : null;
        $this->category = isset($params[4]) && $params[4] !== 'null' && $params[4] ? $params[4] : null;
        $this->alternateTarget = isset($params[5]) && $params[5] !== 'null' && $params[5] ? $params[5] : null;
        $this->defaults = isset($params[6]) && $params[6] !== 'null' && $params[6] ? $params[6] : null;
        if ($this->bindingType === 'variable') {
            $this->extractParametersForVariable($key, $params);
        }
        if ($this->bindingType === 'collection') {
            $this->extractParametersForCollection($key, $params);
        }
    }