@param string $input

@return Ast\Node
973258
public function parse($input)
    {
        $this->inValuePath = false;
        $this->lexer->setInput($input);
        $this->lexer->moveNext();

        $node = null;
        if ($this->mode->equals(Mode::FILTER)) {
            $node = $this->disjunction();
        } else {
            $node = $this->path();
        }

        $this->match(null);

        return $node;
    }
835327
private function filterEmptyInput($input)
    {
        foreach ($input as $key => $value)
        {
            if (empty($value))
            {
                unset($input[$key]);
            }
        }

        return $input;
    }
379392
public function import($input)
    {
        if (is_array($input)) {
            $this->fromArray($input);
        }
        else {
            $this->fromString($input);
        }

        return $this;
    }
879523
public static function pascalToSnakeCase($input)
    {
        preg_match_all('!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!', $input, $matches);

        foreach ($matches[0] as &$match) {
            $match = ($match == strtoupper($match)) ? strtolower($match) : lcfirst($match);
        }

        return implode('_', $matches[0]);
    }
1285989
protected function getCommand($input)
    {
        $input = new StringInput($input);
        if ($name = $input->getFirstArgument()) {
            return $this->get($name);
        }
    }
988405
protected static function tagDispatcher($input)
    {
        // textarea, pre, code tags and comments are to be left alone to avoid any non-wanted whitespace inside them so it just outputs them as they were
        if (substr($input[1], 0, 9) == '<textarea' || substr($input[1], 0, 4) == '<pre' || substr($input[1], 0, 5) == '<code' || substr($input[1], 0, 4) == '<!--' || substr($input[1], 0, 9) == '<![CDATA[') {
            return $input[1] . $input[3];
        }
        // closing textarea, code and pre tags and self-closed tags (i.e. <br />) are printed as singleTags because we didn't use openTag for the formers and the latter is a single tag
        if (substr($input[1], 0, 10) == '</textarea' || substr($input[1], 0, 5) == '</pre' || substr($input[1], 0, 6) == '</code' || substr($input[1], - 2) == '/>') {
            return self::singleTag($input[1], $input[3], $input[2]);
        }
        // it's the closing tag
        if ($input[0][1] == '/') {
            return self::closeTag($input[1], $input[3], $input[2]);
        }

        // opening tag
        return self::openTag($input[1], $input[3], $input[2]);
    }
74171
public static function load($input)
    {
        $config = '';
        if (isset($input['config'])) {
            // set the location of the configuration file
            $config = $input['config'];
        }
        $instance = new self($config);
        $instance->loadUserInput($input);
        $instance->go();
        return $instance;
    }
1169048
public function tokenize($input) : iterable
    {
        if (!is_string($input)) {
            throw new core\exceptions\InvalidArgumentType($input, ['string']);
        }

        // Change line breaks, tabs etc. into whitespaces.
        $length = strlen($input);
        $cursor = 0;
        $i      = 0;
        $tokens = new formats\tokens\Argv;

        while ($cursor < $length) {
            if (preg_match('/\s+/A', $input, $match, null, $cursor)) {
            } elseif (preg_match('/([^="\'\s]+?)(=?)('.static::PATTERN_QUOTED.'+)/A', $input, $match, null, $cursor)) {
                $tokens->set($i++, $match[1].$match[2].stripcslashes(str_replace(['"\'', '\'"', '\'\'', '""'], '', substr($match[3], 1, -1))));
            } elseif (preg_match('/'.static::PATTERN_QUOTED.'/A', $input, $match, null, $cursor)) {
                $tokens->set($i++, stripcslashes(substr($match[0], 1, -1)));
            } elseif (preg_match('/'.static::PATTERN_BARE.'/A', $input, $match, null, $cursor)) {
                $tokens->set($i++, stripcslashes($match[1]));
            } else {
                throw new \RuntimeException('Failed to parse string near "... '.substr($input, $cursor, 10).' ..."');
            }

            $cursor += strlen($match[0]);
        }

        return $tokens;
    }
842899
private function fromCompactSerializationToSerialization($input)
    {
        $parts = explode('.', $input);
        switch (count($parts)) {
            case 3:
                return $this->fromCompactSerializationSignatureToSerialization($parts);
            case 5:
                return $this->fromCompactSerializationRecipientToSerialization($parts);
            default:
                throw new \InvalidArgumentException('Unsupported input');
        }
    }
757313
public function parse($input)
    {
        if (is_null($input) || empty($input)) {
            return $input;
        }
        $character = $this->getOption('character');
        $regex = strtr($this->getOption('regex'), $this->getOption('regex_replacement'));

        preg_match_all($regex, $input, $matches);

        $matches = array_map([$this, 'mapper'], $matches[0]);

        $matches = $this->removeNullKeys($matches);
        $matches = $this->prepareArray($matches);

        $output = preg_replace_callback($matches, [$this, 'replace'], $input);

        return $output;
    }
1305240
public function canonicalize($input)
    {
        $strippedInput = str_replace(' ', '', $input);
        if (!preg_match('/^\d{4}[A-Za-z]{2}$/', $strippedInput)) {
            return $input;
        }

        return implode(' ', [substr($strippedInput, 0, 4), mb_strtoupper(substr($strippedInput, -2, 2))]);
    }
902408
public function html($input = null) {
        if (is_null($input)) {
            return $this->getHtml();
        } else {
            return $this->setHtml($input);
        }
    }
222024
public static function fromString(string $input): self
    {
        $input = preg_replace('/[^\d]/', '', $input);

        if (!is_numeric($input)) {
            throw new \InvalidArgumentException("Expects \$input to be a number, \"{$input}\" given.");
        }

        // Get the last digit.
        $checkDigit = (int) $input[strlen($input) - 1];

        // Remove the last digit.
        $number = substr($input, 0, strlen($input) - 1);

        return new self($number, $checkDigit);
    }
746889
public function tokenize($input)
	{
		$tokens = [];
		$exp = ltrim($input);
		
		for($length = strlen($exp), $i = 0; $i < $length; $i++)
		{
			if(trim($exp[$i]) == '')
			{
				continue;
			}
			
			if(NULL !== ($token = $this->getTerminalToken($exp, $i)))
			{
				$tokens[] = $token;
				
				continue;
			}
			
			if(NULL !== ($token = $this->getStringToken($exp, $length, $i)))
			{
				$tokens[] = $token;
				
				continue;
			}
			
			$sub = substr($exp, $i);
			$m = NULL;
			
			if(preg_match(self::PATTERN_DECIMAL, $sub, $m))
			{
				$tokens[] = $this->getDecimalToken($m);
				$i += strlen($m[1]) - 1;
				
				continue;
			}
			
			if(preg_match(self::PATTERN_INTEGER, $sub, $m))
			{
				$tokens[] = $this->getIntegerToken($m);	
				$i += strlen($m[1]) - 1;
				
				continue;
			}
			
			if(preg_match(self::PATTERN_IDENTIFIER, $sub, $m))
			{
				$tokens[] = $this->getIdentifierToken($m);
				$i += strlen($m[0]) - 1;
				
				continue;
			}
		}
		
		return new AnnotationTokenSequence($tokens);
	}
761110
public function tokenize(string $input) : TokenStream
    {
        $this->prepare($input);

        // Loop each character
        while ($this->cursor < $this->end) {
            $this->currentChar = $this->input[$this->cursor];

            if (preg_match('@'.Token::REGEX_T_EOL.'@', $this->currentChar)) {
                if ($this->mode !== self::MODE_IDENT) {
                    ++$this->line;
                    $this->lineOffset = $this->cursor + 1;
                }
            }

            switch ($this->mode) {

                case self::MODE_ALL:
                    $this->lexAll();
                    break;
                case self::MODE_INSIDE_TAG:
                    $this->lexInsideTag();
                    break;
                case self::MODE_IDENT:
                    $this->lexIdent();
                    break;
                case self::MODE_VAR:
                    $this->lexVar();
                    break;
                case self::MODE_STRING:
                    $this->lexString();
                    break;
                case self::MODE_NUMBER:
                    $this->lexNumber();
                    break;
                case self::MODE_OP:
                    $this->lexOperator();
                    break;
            }
        }

        return $this->stream;
    }
16828
public function before($input): self {
        $this->manipulateNodesWithInput($input, function($node, $newNodes) {
            foreach ($newNodes as $newNode) {
                $node->parent()->insertBefore($newNode, $node);
            }
        });

        return $this;
    }
957944
protected function toBuffer($input)
    {
        if (is_string($input)) {
            if (strpos($input, '0x') === 0) {
                // hex string
                // $input = str_replace('0x', '', $input);
                return new Buffer($input, 'hex');
            }
            return new Buffer(str_split($input, 1));
        } elseif (is_numeric($input)) {
            if (!$input || $input < 0) {
                return new Buffer([]);
            }
            if (is_float($input)) {
                $input = number_format($input, 0, '', '');
                var_dump($input);
            }
            $gmpInput = gmp_init($input, 10);
            return new Buffer('0x' . gmp_strval($gmpInput, 16), 'hex');
        } elseif ($input === null) {
            return new Buffer([]);
        } elseif (is_array($input)) {
            return new Buffer($input);
        } elseif ($input instanceof Buffer) {
            return $input;
        }
        throw new InvalidArgumentException('The input type didn\'t support.');
    }