Get all params from one widget name (option_name)

@param string $str

@return array
427796
public static function getParamsFromWidget($str)
    {
        $option = static::get($str, []);
        unset($option['_multiwidget']);
        $values = array_values($option);
    
        return isset($values[0]) ? $values[0] : [];
    }
915957
private function _do($str)
    {
        $str = (string) $str;
        $strInt = (int) $str;
        $strFloat = (float) $str;
        if (
            !$str
            ||
            (string) $strInt === $str
            ||
            (string) $strFloat === $str
        ) {

            // no xss found
            if ($this->_xss_found !== true) {
                $this->_xss_found = false;
            }

            return $str;
        }

        // remove the BOM from UTF-8 / UTF-16 / UTF-32 strings
        $str = UTF8::remove_bom($str);

        // replace the diamond question mark (�) and invalid-UTF8 chars
        $str = UTF8::replace_diamond_question_mark($str, '');

        // replace invisible characters with one single space
        $str = UTF8::remove_invisible_characters($str, true, ' ');

        // normalize the whitespace
        $str = UTF8::normalize_whitespace($str);

        // decode UTF-7 characters
        $str = $this->_repack_utf7($str);

        // decode the string
        $str = $this->_decode_string($str);

        // remove all >= 4-Byte chars if needed
        if ($this->_stripe_4byte_chars) {
            $str = (string) \preg_replace('/[\x{10000}-\x{10FFFF}]/u', '', $str);
        }

        // backup the string (for later comparision)
        $str_backup = $str;

        // remove strings that are never allowed
        $str = $this->_do_never_allowed($str);

        // corrects words before the browser will do it
        $str = $this->_compact_exploded_javascript($str);

        // remove disallowed javascript calls in links, images etc.
        $str = $this->_remove_disallowed_javascript($str);

        // remove evil attributes such as style, onclick and xmlns
        $str = $this->_remove_evil_attributes($str);

        // sanitize naughty JavaScript elements
        $str = $this->_sanitize_naughty_javascript($str);

        // sanitize naughty HTML elements
        $str = $this->_sanitize_naughty_html($str);

        // final clean up
        //
        // -> This adds a bit of extra precaution in case something got through the above filters.
        $str = $this->_do_never_allowed_afterwards($str);

        // check for xss
        if ($this->_xss_found !== true) {
            $this->_xss_found = !($str_backup === $str);
        }

        return $str;
    }
169592
protected static function parseAs($str, $alias1 = null) {
        $table = preg_split('#\b(as|\s+)\b#i', trim($str));
        if (count($table) == 1) {
            $name  = $table [0];
            $alias = $alias1;
        } else {
            $name  = $table [0];
            $alias = trim(array_pop($table));
        }

        return [trim($name), trim($alias)];
    }
550025
private function parseLine($str, $color = null)
    {
        $parsed = [];
        $lines = explode(PHP_EOL, $str);
        $last = count($lines) - 1;
        foreach ($lines as $key => $line) {
            $parsed[] = [
                'colored' => $color ? sprintf("\033[%sm%s\033[0m", $color, $line) : $line,
                'original' => $line,
                'newline' => $key < $last
            ];
        }

        return $parsed;
    }
898078
private function getOptionsSearchStrings() {
        if (empty($this->searchStringsCache)) {
            $this->searchStringsCache = array(
                0 => '',
                1 => array(),
            );
            foreach ($this->parameters as $Option) {
                $postfix = self::getPostfix($Option);
                /** @var $Option Option */
                $this->searchStringsCache[0] .= $Option->getShort() . $postfix;
                $this->searchStringsCache[1][] = $Option->getLong() . $postfix;
            }
        }
        return $this->searchStringsCache;
    }
580532
private function getApplyQueryStringParams()
    {
        $qsParams = [
            $this->getFilter()->getRequestVar()      => $this->getApplyValue(),
            $this->_htmlPagerBlock->getPageVarName() => null,
        ];

        return $qsParams;
    }
1279817
public static function getString(&$str)
    {
        $p = strpos($str, "\x00");
        if ($p === false) {
            return '';
        }
        $r   = static::binarySubstr($str, 0, $p);
        $str = static::binarySubstr($str, $p + 1);

        return $r;
    }
461042
function parse($str) {
		preg_match_all('/(\w+)\h*=\h*(.+?)(?=,|$)/',
			$str,$pairs,PREG_SET_ORDER);
		$out=array();
		foreach ($pairs as $pair)
			$out[$pair[1]]=trim($pair[2]);
		return $out;
	}
1102097
function scan($str) {
		$inline=['img','a','text','auto','code'];
		foreach ($inline as $func)
			$str=$this->{'_'.$func}($str);
		return $str;
	}
715512
public function getOptions($strClassName, $strFieldName)
    {
        if (isset($this->options[$strClassName][$strFieldName])) {
            return $this->options[$strClassName][$strFieldName];
        } else {
            return array();
        }
    }
1189399
public function get_js_options() {
        $jsoptions = '';

        foreach ($this->params as $var => $val) {
            if (is_string($val) || is_int($val)) {
                $jsoptions .= "$var=$val,";
            } elseif (is_bool($val)) {
                $jsoptions .= ($val) ? "$var," : "$var=0,";
            }
        }

        $jsoptions = substr($jsoptions, 0, strlen($jsoptions) - 1);

        return $jsoptions;
    }
31175
protected function parseCommentsVars(string $str): string
    {
        // not use vars
        if (false === \strpos($str, self::HELP_VAR_LEFT)) {
            return $str;
        }

        static $map;

        if ($map === null) {
            foreach ($this->commentsVars as $key => $value) {
                $key = self::HELP_VAR_LEFT . $key . self::HELP_VAR_RIGHT;
                // save
                $map[$key] = $value;
            }
        }

        return $map ? \strtr($str, $map) : $str;
    }
264573
function parse($str) {
		preg_match_all('/(\w+|\*)\h*=\h*(?:\[(.+?)\]|(.+?))(?=,|$)/',
			$str,$pairs,PREG_SET_ORDER);
		$out=[];
		foreach ($pairs as $pair)
			if ($pair[2]) {
				$out[$pair[1]]=[];
				foreach (explode(',',$pair[2]) as $val)
					array_push($out[$pair[1]],$val);
			}
			else
				$out[$pair[1]]=trim($pair[3]);
		return $out;
	}
1139890
protected function getInlineOption($name, $str, $defaultValue)
	{
		if(preg_match('/'.$name.'(\s*=\s*(\d+))?/i', $str, $v) && count($v) > 2)
			return $v[2];
		else
			return $defaultValue;
	}
602721
function getParams()
    {
        $params = array();
        foreach (get_object_vars($this) as $k => $v) {
            if ($k[0] == '_') {
                $params[substr($k, 1)] = $v;
            }
        }

        return $params;
    }
315973
protected function extractNodeFromBBCode($str)
    {
        $references = array();
        /** @var \OpenOrchestra\BBcodeBundle\Parser\BBcodeParserInterface $parserBBcode */
        $parsedBBcode = $this->bbcodeParser->parse($str);
        $nodeTags = $parsedBBcode->getElementByTagName(InternalLinkDefinition::TAG_NAME);
        /** @var \OpenOrchestra\BBcodeBundle\ElementNode\BBcodeElementNodeInterface $mediaTag */
        foreach ($nodeTags as $nodeTag) {
            $linkAttribute = json_decode(html_entity_decode($nodeTag->getAttribute()['link']), true);
            $nodeId = $linkAttribute['site']['nodeId'];
            $siteId = $linkAttribute['site']['siteId'];
            $references[] = array('nodeId' => $nodeId, 'siteId' => $siteId);
        }
        return $references;
    }
1140485
public static function getStrong($str)
    {
        /*
         * Split the content by html tags.
         */
        $tree = preg_split(
            '/(<[^!]?[^>]+>(<![^>]+>)?)/',
            $str,
            -1,
            PREG_SPLIT_OFFSET_CAPTURE | PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY
        );

        /*
         * Initiate variables.
         */
        $r = array();
        $line = '';
        $isInline = true;
        $oneLine = array();
        $lastWasTag = false;

        /*
         * Loop throu the tree.
         */
        foreach ($tree as $k => $elm) {
            /*
             * Check what kind of element this is.
             */
            $info;
            switch (self::_getTreeElm($elm[0], $info)) {
            case 'start':
                /*
                 * It's a starting tag
                 */
                $add = new Tag(
                    $info[1], /* The Tags Name */
                    array(self::parseAttrs($info[2])), /* The attributes */
                    array(
                        'generate',
                        ($info[3] == '/>' ? 'selfQlose' : 'doNotSelfQlose'),
                        'start',
                        (in_array($info[1], TagInfo::$inlineTags) ? 'inline' : null)
                    )
                );
                break;
            case 'end':
                /*
                 * It is a closing tag
                 */
                $add = Store::get();
                break;
            case 'comment':
            case 'content':
            default:
                /*
                 * It's something else
                 */
                $add = $elm[0];
                break;
            }

            /*
             * Add the current content to the output.
             */
            self::_toLine($add, $r, $line, $isInline, $oneLine, $lastWasTag);
        }

        /*
         * Check if there is still content in the current line
         * and add it to the return array.
         */
        if (strlen($line)) {
            $r[] = $line;
        }

        /*
         * implode the return array using line breaks and return the string.
         */

        return implode(Generator::getLineBreak(), $r).Generator::getLineBreak();
    }