Convert the arrays to the shorthand syntax.

@param string $source
@param string $code

@return string
17048
protected function dumpLangArray($source, $code = '')
    {
        // Use array short syntax
        if ($this->config('array_shorthand', true) === false) {
            return $source;
        }

        // Split given source into PHP tokens
        $tokens = token_get_all($source);

        $brackets = [];

        for ($i = 0; $i < count($tokens); $i++) {
            $token = $tokens[$i];

            if ($token === '(') {
                $brackets[] = false;
            }
            elseif ($token === ')') {
                $token = array_pop($brackets) ? ']' : ')';
            }
            elseif (is_array($token) && $token[0] === T_ARRAY) {
                $a = $i + 1;
                if (isset($tokens[$a]) && $tokens[$a][0] === T_WHITESPACE) {
                    $a++;
                }
                if (isset($tokens[$a]) && $tokens[$a] === '(') {
                    $i = $a;
                    $brackets[] = true;
                    $token = '[';
                }
            }

            $code .= is_array($token) ? $token[1] : $token;
        }

        // Fix indenting
        $code = preg_replace('/^  |\G  /m', '    ', $code);

        // Fix weird new line breaks at the beginning of arrays
        $code = preg_replace('/=\>\s\n\s{4,}\[/m', '=> [', $code);

        return $code;
    }
1216019
public function token($code) {
        if (!is_array($code)) {
            $code = [
                'code' => $code,
            ];
        }
        return $this->getToken()->parameters($code)->text();
    }
683071
protected function toString($codes, $options = [])
    {
        $glue = isset($options['glue']) ? $options['glue'] : static::$glue;
        return $this->clean(implode($glue, $this->getSubfieldValues($codes)), $options);
    }
655224
public static function get($code)
  {
    if (array_key_exists($code, self::$translations)) {
      return self::$translations[$code];
    }
    return sprintf('[%s]', $code);
  }
741437
public function parse($source)
		{
		// Reset
		$this->source = "";
		$this->tokens = array();
		// Create a global and plugin lookup table for trigger chars; set array of plugins as local variable and create 
		// several helper variables for plugin handling
		$globalTriggerChars		= "";
		$plugins				= $this->plugins;
		$pluginCount			= count($plugins);
		$pluginIndex			= array();
		$pluginTriggerStates	= array();
		$pluginTriggerChars		= array();
		for ($i = 0, $l = count($plugins); $i < $l; $i++)
			{
			$tPluginClassName				= get_class($plugins[$i]);
			$pluginTriggerChars[$i]			= implode("", $plugins[$i]->getTriggerChars());
			$tPluginTriggerStates			= $plugins[$i]->getTriggerStates();
			$pluginTriggerStates[$i]		= $tPluginTriggerStates === false ? false : "|" . implode("|", $tPluginTriggerStates) . "|";
			$pluginIndex[$tPluginClassName]	= $i;
			for ($ii = 0, $ll = strlen($pluginTriggerChars[$i]); $ii < $ll; $ii++)
				{
				$c = substr($pluginTriggerChars[$i], $ii, 1);
				if (strpos($globalTriggerChars, $c) === false)
					{
					$globalTriggerChars .= $c;
					}
				}
			}
		// Normalise line endings
		$source			= str_replace("\r\n", "\n", $source);	// Windows to Unix line endings
		$source			= str_replace("\r", "\n", $source);		// Mac to Unix line endings
		$this->source	= $source;
		// Variables
		$buffer			= &$this->buffer;
		$exclusive		= &$this->stateExclusive;
		$state			= &$this->state;
		$c = $p 		= null;
		// --
		for ($i = 0, $l = strlen($source); $i < $l; $i++)
			{
			// Set the current Char
			$c = $source[$i]; // Is faster than: $c = substr($source, $i, 1);
			// Normalize and filter double whitespace characters
			if ($exclusive === false)
				{
				if ($c === "\n" || $c === "\t")
					{
					$c = " ";
					}
				if ($c === " " && $p === " ")
					{
					continue;
					}
				}
			$buffer .= $c;
			// Extended processing only if the current char is a global trigger char
			if (strpos($globalTriggerChars, $c) !== false)
				{
				// Exclusive state is set; process with the exclusive plugin 
				if ($exclusive)
					{
					$tPluginIndex = $pluginIndex[$exclusive];
					if (strpos($pluginTriggerChars[$tPluginIndex], $c) !== false && ($pluginTriggerStates[$tPluginIndex] === false || strpos($pluginTriggerStates[$tPluginIndex], $state) !== false))
						{
						$r = $plugins[$tPluginIndex]->parse($i, $c, $p, $state);
						// Return value is TRUE => continue with next char
						if ($r === true)
							{
							continue;
							}
						// Return value is numeric => set new index and continue with next char
						elseif ($r !== false && $r != $i)
							{
							$i = $r;
							continue;
							}
						}
					}
				// Else iterate through the plugins
				else
					{
					$triggerState = "|" . $state . "|";
					for ($ii = 0, $ll = $pluginCount; $ii < $ll; $ii++)
						{
						// Only process if the current char is one of the plugin trigger chars
						if (strpos($pluginTriggerChars[$ii], $c) !== false && ($pluginTriggerStates[$ii] === false || strpos($pluginTriggerStates[$ii], $triggerState) !== false))
							{
							// Process with the plugin
							$r = $plugins[$ii]->parse($i, $c, $p, $state);
							// Return value is TRUE => break the plugin loop and and continue with next char
							if ($r === true)
								{
								break;
								}
							// Return value is numeric => set new index, break the plugin loop and and continue with next char
							elseif ($r !== false && $r != $i)
								{
								$i = $r;
								break;
								}
							}
						}
					}
				}
			$p = $c; // Set the parent char
			}
		return $this->tokens;
		}
1332640
final public static function get_header_string(int $code) {
		if (!isset(self::$header_string[$code]))
			$code = 404;
		return [
			'code' => $code,
			'msg'  => self::$header_string[$code],
		];
	}
580507
public function columnsShortCodeHandler( $atts, $content, $shortcode ) {
		if ( ! $content ) {
			return '';
		}

		$atts = shortcode_atts(
			[
				'class' => null,
				'count' => 2,
			],
			$atts,
			$shortcode
		);

		$classes = $atts['class'] ?? '';

		switch ( $atts['count'] ) {
			case 2:
				$classes .= ' twocolumn';
				break;
			case 3:
				$classes .= ' threecolumn';
				break;
			default:
				$classes .= ' twocolumn';
		}

		return sprintf(
			'<div class="%1$s">%2$s</div>',
			trim( $classes ),
			wpautop( trim( $content ) )
		);
	}
1055172
public function merge_4value_radius_shorthands($array) {
		$return = $array;
		$shorthands = & $this->parser->data['csstidy']['radius_shorthands'];

		foreach ($shorthands as $key => $value) {
			if (isset($array[$value[0]]) && isset($array[$value[1]])
							&& isset($array[$value[2]]) && isset($array[$value[3]]) && $value !== 0) {
				$return[$key] = '';
				$a = array();
				for ($i = 0; $i < 4; $i++) {
					$v = $this->explode_ws(' ', trim($array[$value[$i]]));
					$a[0][$value[$i]] = reset($v);
					$a[1][$value[$i]] = end($v);
				}
				$r = array();
				$r[0] = $this->merge_4value_shorthands($a[0], $shorthands);
				$r[1] = $this->merge_4value_shorthands($a[1], $shorthands);

				if (isset($r[0][$key]) and isset($r[1][$key])) {
					$return[$key] = $r[0][$key];
					if ($r[1][$key] !== $r[0][$key]) {
						$return[$key] .= ' / ' . $r[1][$key];
					}
					for ($i = 0; $i < 4; $i++) {
						unset($return[$value[$i]]);
					}
				}
			}
		}
		return $return;
	}
820419
public function tokens($source, $offset)
    {
        $tokens = array();

        $rawTokens = token_get_all('<?php ' . substr($source, $offset));
        array_shift($rawTokens);

        foreach ($rawTokens as $token) {
            $tokens = array_merge($tokens, $this->normalizeToken($token));
        }

        $tokens = $this->collapseQuotedStrings($tokens);
        $tokens = $this->collapseConsecutiveStrings($tokens);

        return $tokens;
    }
584387
private function optimizeScriptCode($code)
	{
		if (YII_DEBUG)
			return $code;
		require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'JSMin.php';
		$minified = JSMin::minify($code);

		return ($minified === false ? $code : $minified);
	}
267952
public function codeDesc()
    {
        // Cast code to string from SimpleXMLObject
        $code = (string)$this->code;
        return array_key_exists($code, self::$codes) ? self::$codes[$code] : '';
    }
277654
public function transpile($code)
    {
        try {
            return AfxService::convertAfxToFusion($code);
        } catch (AfxException $afxException) {
            throw new Fusion\Exception(sprintf('Error during AFX-parsing: %s', $afxException->getMessage()));
        }
    }
1160748
public function emailShortCodeHandler( $atts, $content, $shortcode ) {
		$atts = shortcode_atts(
			[
				'class' => null,
				'address' => null,
			],
			$atts,
			$shortcode
		);

		$address = $atts['address'] ?? $content;

		if ( ! is_email( $address ) ) {
			return '';
		}

		if ( $address === $content ) {
			return sprintf(
				'<a href="mailto:%1$s"%2$s>%1$s</a>',
				antispambot( $address ),
				( isset( $atts['class'] ) ) ? sprintf( ' class="%s"', $atts['class'] ) : ''
			);
		} else {
			return sprintf(
				'<a href="mailto:%1$s"%2$s>%3$s</a>',
				antispambot( $address ),
				( isset( $atts['class'] ) ) ? sprintf( ' class="%s"', $atts['class'] ) : '',
				( $content ) ? $content : antispambot( $address )
			);
		}
	}
308221
public function tokenize($code, $filename = null)
    {
        if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) {
            $encoding = mb_internal_encoding();
            mb_internal_encoding('ASCII');
        }

        $this->code = str_replace(array("\r\n", "\r"), "\n", $code);
        $this->source = '';
        $this->filename = $filename;
        $this->cursor = 0;
        $this->lineno = 1;
        $this->end = strlen($this->code);
        $this->tokens = array();
        $this->state = self::STATE_DATA;
        $this->states = array();
        $this->brackets = array();
        $this->position = -1;

        preg_match_all(self::REGEX_CHAR, $this->code, $this->positions, PREG_OFFSET_CAPTURE);

        while ($this->cursor < $this->end) {
            switch ($this->state) {
                case self::STATE_DATA:
                    $this->lexData();
                    break;

                case self::STATE_OUTPUT:
                    $this->lexOutput();
                    break;

                case self::STATE_DIRECTIVE:
                    $this->lexDirective();
                    break;
            }
        }

        if ($this->state != self::STATE_DATA) {
            $this->addCode(' ?>');
            $this->popState();
        }

        if (!empty($this->brackets)) {
            list($expect, $lineno) = array_pop($this->brackets);
            throw new SyntaxErrorException(sprintf('Unclosed "%s" at line %d in file %s', $expect, $lineno, $this->filename));
        }

        if (isset($encoding)) {
            mb_internal_encoding($encoding);
        }

        return new TokenStream(token_get_all($this->source));
    }
586671
public function skipChars($pos, $code)
    {
        for ($max = strlen ($this->src); $pos < $max; $pos++) {
            if ($this->src[$pos] !== $code) { break; }
        }
        return $pos;
    }
1118270
private function generatePhpCode($code,$offset)
	{
		$line=$this->getLineNumber($offset);
		$code=str_replace('__FILE__',var_export($this->_sourceFile,true),$code);
		return "<?php /* line $line */ $code ?>";
	}
287466
public static function getDescription($code)
    {
        if (array_key_exists($code, self::$codes_to_string_map)) {
            return self::$codes_to_string_map[$code];
        } else {
            return false;
        }
    }