@param string $string

@return array|null
512080
protected static function stringToArray($string)
    {
        $data = null;

        try
        {
            $data = \GuzzleHttp\json_decode($string, true);
        }
        catch (\InvalidArgumentException $e)
        {

        }

        return $data;
    }
462911
public static function decode($string)
    {
        if (is_array($string)) {
            foreach ($string as $k => $substring) {
                $string[$k] = static::decode($substring);
            }
        } else {
            $string = urldecode($string);
        }

        return $string;
    }
162895
public function parseString($string)
    {
        //argument 1 must be a string
        Argument::i()->test(1, 'string');
        
        foreach ($this->data as $key => $value) {
            $string = str_replace($key, $value, $string);
        }

        return $string;
    }
1168220
public function trimValue($string){
			if (is_array($string)) {
				foreach ($string as $k => $v) {
					$string[$k] = $this->trimValue($v);
				}
			} else if (is_string ($string)) {
				return trim($string);
			}
			return $string;
		}
67019
public static function decode($string)
    {
        return ($string === self::NULL) ? null : strtr($string, self::$decodeMap);
    }
1337568
public function string($string = NULL)
	{
		if (func_num_args() === 0)
		{
			return $this->_string;
		}
		$this->_string = $string;
		return $this;
	}
534739
protected function extractNamespace($string)
    {
        $string = trim($string);

        if ($this->isQualifiedNamespace($string) && ($index = strrpos($string, '::')) != false) {
            $namespace = substr($string, 0, $index);

            if (!empty($namespace)) {
                return $this->getUseClassCommand($namespace);
            }
        }

        return null;
    }
201631
protected function parse_vars($string)
	{
		foreach ($this->vars as $var => $val)
		{
			$string = str_replace("%$var%", $val, $string);
		}

		return $string;
	}
100254
private function separateSelectString(string $string)
    {
        if (false === strpos($string, '(')) {
            return array_map('trim', explode(',', $string));
        }

        $opened = $closed = 0;
        $cnt = mb_strlen($string);
        $arrayStrings = [];
        $substring = '';

        for ($i = 0; $i < $cnt; $i++) {
            $substring .= $string[$i];
            if ('(' === $string[$i]) {
                $opened++;
            } elseif (')' === $string[$i]) {
                $closed++;
            } elseif (',' === $string[$i] && $opened === $closed) {
                $arrayStrings[] = trim($substring);
            }
        }
        $arrayStrings[] = trim($substring);

        return $arrayStrings;
    }
725020
protected function toTokens(string $string = null): array
    {
        $tokens = parent::toTokens(parent::getBodyAsString());

        // Try creating any parameters
        foreach ($this->parameters as $name => $value) {
            if (null !== $value) {
                // Add the semi-colon separator
                $tokens[\count($tokens) - 1] .= ';';
                $tokens = array_merge($tokens, $this->generateTokenLines(' '.$this->createParameter($name, $value)));
            }
        }

        return $tokens;
    }
610276
public function parseTokens($string)
    {
        $this->string = $string;
        $this->cursor = 0;
        $this->current = isset($this->string[0]) ? $this->string[0] : null;
        $this->next = isset($this->string[1]) ? $this->string[1] : null;

        // Unify result of ctype_space() across systems
        $previousLocale = setlocale(LC_CTYPE, 0);
        setlocale(LC_CTYPE, 'C');
        $tokens = $this->doParseTokens();
        setlocale(LC_CTYPE, $previousLocale);

        return $tokens;
    }
676982
public function parse($string) {
        if (is_array($string)) {
            $string = implode(' ', $string);
        }

        $args = $this->parseString($string);
        $args = $this->unquoteMatches($args);
        $args = $this->normalizeShortOptions($args);

        return $args;
    }
145212
public function reverseTransform($string)
    {
        if ($string === null) {
            return null;
        }

        $rClass = new \ReflectionClass($this->specificationClass);
        $args = $this->constructorArgs;
        array_unshift($args, $string);

        return $rClass->newInstanceArgs($args);
    }
1259131
protected function parsePhileFormat($string) {
        if (empty($string)) {
            return null;
        }
        $meta = [];
        $lines = explode("\n", $string);
        foreach ($lines as $line) {
            $parts = explode(':', $line, 2);
            if (count($parts) !== 2) {
                continue;
            }
            $parts = array_map('trim', $parts);
            $meta[$parts[0]] = $parts[1];
        }
        return $meta;
    }
1339199
public function parseString($string)
    {
        $string = (string) $string;
        $string = preg_replace_callback("/\\$\{(.*?)\}/",
            function ($k) {
                return $this->get($k[1]);
            }, $string);

        return $string;
    }
365243
public function getArrayWhereKeysBeginWith($string)
    {
        if (empty($this->config)) {
            $this->getArray();
        }
        $config = $this->config;

        $thisConfig = array();
        $cleanNameLength = mb_strlen($string);
        $string = mb_strtolower($string);
        foreach ($config as $key => $value) {
            $begin = substr($key, 0, $cleanNameLength);
            if (mb_strtolower($begin) == $string) {
                $thisConfig[$key] = $value;
            }
        }
        return $thisConfig;
    }
370375
protected function nativeJsonDecode($string)
    {
        $result = @json_decode($string, \true);

        if (!$result || JSON_ERROR_NONE !== json_last_error()) {
            $result = \null;
        }

        return $result;
    }