@param null $previousExpression

@return mixed

@throws ForbiddenTokenException
@throws UnexpectedTokenException
@throws UnsupportedTokenTypeException
187228
private function getExpression($previousExpression = null)
    {
        $expression = $previousExpression ?: null;
        $expectedTokenType = null !== $previousExpression ? Lexer::T_COMPOSITE : Lexer::T_OPEN_PARENTHESIS | Lexer::T_INPUT_PARAMETER;
        $expressions = array();
        $tokenPrecedence = null;

        $hasOpenParenthesis = false;

        $compositeOperator = null;
        $contains = false;
        $containsValue = null;
        $comparisonFirstOperande = null;
        $comparisonMultipleOperande = false;
        $comparisonMethod = null;

        while ($currentToken = $this->getNextToken()) {
            $currentTokenType = $currentToken['type'];
            $currentTokenIndex = $this->lexerIndex;
            $this->lexerIndex++;

            if (!($this->supportedTokenType & $currentTokenType)) {
                throw new UnsupportedTokenTypeException($currentToken, $this->lexer->getTokenSyntax($this->supportedTokenType));
            }

            if (!($this->allowedTokenType & $currentTokenType)) {
                throw new ForbiddenTokenException($currentToken, $this->lexer->getTokenSyntax($this->allowedTokenType));
            }

            if (!($expectedTokenType & $currentTokenType)) {
                throw new UnexpectedTokenException($currentToken, $this->lexer->getTokenSyntax($expectedTokenType));
            }

            switch ($currentTokenType) {
                case Lexer::T_OPEN_PARENTHESIS:
                    $expression = $this->getExpression();
                    $hasOpenParenthesis = true;
                    $expectedTokenType = Lexer::T_CLOSE_PARENTHESIS;
                    break;
                case Lexer::T_CLOSE_PARENTHESIS:
                    if (!$hasOpenParenthesis) {
                        $this->lexerIndex = $currentTokenIndex;
                        $this->lexer->resetPosition($currentTokenIndex);
                        $this->lexer->moveNext();

                        break 2;
                    }
                    $hasOpenParenthesis = false;
                    $expectedTokenType = Lexer::T_COMPOSITE | Lexer::T_CLOSE_PARENTHESIS;
                    break;
                case Lexer::T_COMMA:
                    $expectedTokenType = Lexer::T_OPERANDE;
                    break;
                case Lexer::T_INPUT_PARAMETER:
                    $currentTokenValue = $this->expressionBuilder->parameter($currentToken['value'], null !== $comparisonFirstOperande);
                case Lexer::T_STRING:
                    if (!isset($currentTokenValue)) {
                        $currentTokenValue = $this->expressionBuilder->string($currentToken['value']);
                    }
                case Lexer::T_INTEGER:
                case Lexer::T_FLOAT:
                    if (!isset($currentTokenValue)) {
                        $currentTokenValue = $currentToken['value'];
                    }
                    if (null === $comparisonFirstOperande) {
                        $comparisonFirstOperande = $currentTokenValue;
                        $expectedTokenType = Lexer::T_COMPARISON;
                        $currentTokenValue = null;
                        break;
                    }

                    if (is_array($comparisonMultipleOperande)) {
                        $comparisonMultipleOperande[] = $currentTokenValue;
                        $expectedTokenType = Lexer::T_COMMA | Lexer::T_CLOSE_SQUARE_BRACKET;
                        $currentTokenValue = null;
                        break;
                    }

                    if ($contains) {
                        $containsValue = $currentTokenValue;
                        $expectedTokenType = Lexer::T_DOUBLE_CLOSE_CURLY_BRACKET;
                        $currentTokenValue = null;
                        break;
                    }

                    $expression = call_user_func_array(array($this->expressionBuilder, $comparisonMethod), array($comparisonFirstOperande, $currentTokenValue));
                    $comparisonFirstOperande = null;
                    $comparisonMethod = null;
                    $currentTokenValue = null;
                    $expectedTokenType = Lexer::T_COMPOSITE | Lexer::T_CLOSE_PARENTHESIS;
                    break;
                case Lexer::T_EQUALS:
                    $comparisonMethod = 'eq';
                    $expectedTokenType = Lexer::T_OPERANDE;
                    break;
                case Lexer::T_NOT_EQUALS:
                    $comparisonMethod = 'neq';
                    $expectedTokenType = Lexer::T_OPERANDE;
                    break;
                case Lexer::T_GREATER_THAN:
                    $comparisonMethod = 'gt';
                    $expectedTokenType = Lexer::T_OPERANDE;
                    break;
                case Lexer::T_GREATER_THAN_EQUALS:
                    $comparisonMethod = 'gte';
                    $expectedTokenType = Lexer::T_OPERANDE;
                    break;
                case Lexer::T_LOWER_THAN:
                    $comparisonMethod = 'lt';
                    $expectedTokenType = Lexer::T_OPERANDE;
                    break;
                case Lexer::T_LOWER_THAN_EQUALS:
                    $comparisonMethod = 'lte';
                    $expectedTokenType = Lexer::T_OPERANDE;
                    break;
                case Lexer::T_NOT_OPEN_SQUARE_BRACKET:
                    $comparisonMethod = 'notIn';
                    $comparisonMultipleOperande = array();
                    $expectedTokenType = Lexer::T_OPERANDE | Lexer::T_CLOSE_SQUARE_BRACKET;
                    break;
                case Lexer::T_OPEN_SQUARE_BRACKET:
                    $comparisonMethod = 'in';
                    $comparisonMultipleOperande = array();
                    $expectedTokenType = Lexer::T_OPERANDE | Lexer::T_CLOSE_SQUARE_BRACKET;
                    break;
                case Lexer::T_CLOSE_SQUARE_BRACKET:
                    $expression = call_user_func_array(array($this->expressionBuilder, $comparisonMethod), array($comparisonFirstOperande, $comparisonMultipleOperande));
                    $comparisonMethod = null;
                    $comparisonFirstOperande = null;
                    $comparisonMultipleOperande = false;
                    $expectedTokenType = Lexer::T_COMPOSITE | Lexer::T_CLOSE_PARENTHESIS;
                    break;
                case Lexer::T_DOUBLE_OPEN_CURLY_BRACKET:
                    $comparisonMethod = 'contains';
                    $contains = true;
                    $expectedTokenType = Lexer::T_OPERANDE | Lexer::T_DOUBLE_CLOSE_CURLY_BRACKET;
                    break;
                case Lexer::T_NOT_DOUBLE_OPEN_CURLY_BRACKET:
                    $comparisonMethod = 'notContains';
                    $contains = true;
                    $expectedTokenType = Lexer::T_OPERANDE | Lexer::T_DOUBLE_CLOSE_CURLY_BRACKET;
                    break;
                case Lexer::T_DOUBLE_CLOSE_CURLY_BRACKET:
                    $expression = call_user_func_array(array($this->expressionBuilder, $comparisonMethod), array($comparisonFirstOperande, $containsValue));
                    $comparisonMethod = null;
                    $comparisonFirstOperande = null;
                    $contains = false;
                    $expectedTokenType = Lexer::T_COMPOSITE | Lexer::T_CLOSE_PARENTHESIS;
                    break;

                case Lexer::T_AND:
                case Lexer::T_NOT_AND:
                case Lexer::T_OR:
                case Lexer::T_NOT_OR:
                case Lexer::T_XOR:
                    $currentTokenPrecedence = $this->precedence[$currentTokenType];
                    if (null === $compositeOperator || $currentTokenType === $compositeOperator) {
                        $expressions[] = $expression;
                        $expression = null;
                        $compositeOperator = $currentTokenType;
                        $tokenPrecedence = $currentTokenPrecedence;
                        $expectedTokenType = Lexer::T_OPEN_PARENTHESIS | Lexer::T_INPUT_PARAMETER;
                        break;
                    }

                    if ($currentTokenPrecedence < $tokenPrecedence) {
                        $expressions[] = $expression;
                        $expression = null;
                        $expressions = array($this->buildComposite($compositeOperator, $expressions));
                        $compositeOperator = $currentTokenType;
                        $tokenPrecedence = $currentTokenPrecedence;
                        $expectedTokenType = Lexer::T_OPEN_PARENTHESIS | Lexer::T_INPUT_PARAMETER;
                        break;
                    }

                    if ($currentTokenPrecedence > $tokenPrecedence) {
                        $this->lexerIndex = $currentTokenIndex;
                        $this->lexer->resetPosition($currentTokenIndex);
                        $this->lexer->moveNext();
                        $expression = $this->getExpression($expression);
                        break;
                    }

                    throw new \LogicException(sprintf(
                        'Token precedence error. Current token precedence %s must be different than %s',
                        $currentTokenPrecedence,
                        $tokenPrecedence
                    ));
                default:
                    throw new \LogicException(sprintf(
                        'Token mismatch. Expected token %s given %s',
                        $this->lexer->getLiteral($expectedTokenType),
                        $currentTokenType
                    ));
            }
        }

        if (null !== $expression) {
            $expressions[] = $expression;
        }

        if (count($expressions) === 1) {
            return $expressions[0];
        }

        return $this->buildComposite($compositeOperator, $expressions);
    }
1144058
public function nextToken()
    {
        if ($this->_input === null) {
            return null;
        }

        do {
            if (! preg_match('/[\p{L}\p{N}]+/u', $this->_input, $match, PREG_OFFSET_CAPTURE, $this->_bytePosition)) {
                // It covers both cases a) there are no matches (preg_match(...) === 0)
                // b) error occured (preg_match(...) === FALSE)
                return null;
            }

            // matched string
            $matchedWord = $match[0][0];

            // binary position of the matched word in the input stream
            $binStartPos = $match[0][1];

            // character position of the matched word in the input stream
            $startPos = $this->_position +
                        iconv_strlen(
                            substr(
                                $this->_input,
                                $this->_bytePosition,
                                $binStartPos - $this->_bytePosition
                            ),
                            'UTF-8'
                        );
            // character postion of the end of matched word in the input stream
            $endPos = $startPos + iconv_strlen($matchedWord, 'UTF-8');

            $this->_bytePosition = $binStartPos + strlen($matchedWord);
            $this->_position     = $endPos;

            $token = $this->normalize(new Zend_Search_Lucene_Analysis_Token($matchedWord, $startPos, $endPos));
        } while ($token === null); // try again if token is skipped

        return $token;
    }
357173
public function apply($dbDriver, $alias, $field, $exprValue, $namedParameter = null, &$value = null)
	{
		$matches = [];
		
		if (!preg_match(self::PATTERN, $exprValue, $matches)) {
			throw new BadQueryExprException(sprintf('The query expression converter "range" does not support the following pattern "%s".', $exprValue));
		}
		
		switch (true) {
			case $matches[2] && !$matches[3]:
				return $this->createGreaterExpr($field, $matches[1], trim($matches[2]));
				
			case !$matches[2] && $matches[3]:
				return $this->createLessExpr($field, $matches[4], trim($matches[3]));
				
			case $matches[2] && $matches[3]:
				return (new \Doctrine\MongoDB\Query\Expr())->addAnd(
						$this->createGreaterExpr($field, $matches[1], trim($matches[2])), 
						$this->createLessExpr($field, $matches[4], trim($matches[3]))
					);
				
			default:
				throw new BadQueryExprException('the range query expression converter requires left or right value of range');
		}
	}
456586
private function createAuthenticationException(JWTDecodeFailureException $previous = null)
    {
        $message = (null === $previous) ? 'Invalid JWT Token' : $previous->getMessage();

        return new AuthenticationException($message, 401, $previous);
    }
58713
private static function createExceptionMessage(
        RequestException $previous,
        ResponseInterface $response = null
    ): string {
        if (!$response) {
            return $previous->getMessage();
        }

        try {
            $result = guzzle_json_decode((string) $response->getBody(), true);
            if (isset($result['message'])) {
                return $result['message'];
            }
        } catch (\InvalidArgumentException $e) {
            return $previous->getMessage();
        }

        return $previous->getMessage();
    }
58071
public function prev() {
		$prev = $this->domnode;
		if(!$prev)
			return new Node(null);
		while(true) {
			$prev = $prev->previousSibling;
			if(!$prev)
				return new Node(null);
			if($prev->nodeType == XML_ELEMENT_NODE)
				return new Node($prev);
		}
	}
801169
public function convertExpressionsToStrings()
    {
        $this->setMainQuery((string) $this->getMainQuery());

        $this->setFilterQueries(array_map(
            function($expr) { return (string) $expr; },
            $this->getFilterQueries()
        ));

        return $this;
    }
87378
protected function resolveBefore($before)
    {
        $getBefore = $this->resolveMiddleware($before);

        return function (Request $request, Application $app) use ($getBefore) {
            $callback = $getBefore($request);
            if (!is_callable($callback)) {
                return null;
            }

            return $callback($request, $app);
        };
    }
1327577
@CheckForNull
    private DetailAST getExprAst(@Nonnull final DetailAST pAst)
    {
        DetailAST result = null;
        for (DetailAST a = pAst.getFirstChild(); a != null; a = a.getNextSibling()) {
            if (a.getType() != TokenTypes.LPAREN && a.getType() != TokenTypes.RPAREN) {
                result = a;
                break;
            }
        }
        return result;
    }
682281
public function resolveExpressionNodeToType($expr)
    {
        // PARENTHESIZED EXPRESSION
        // Retrieve inner expression from parenthesized expression
        while ($expr instanceof Node\Expression\ParenthesizedExpression) {
            $expr = $expr->expression;
        }

        if ($expr == null || $expr instanceof PhpParser\MissingToken || $expr instanceof PhpParser\SkippedToken) {
            // TODO some members are null or Missing/SkippedToken
            // How do we handle this more generally?
            return new Types\Mixed_;
        }

        // VARIABLE
        //   $this -> Type\this
        //   $myVariable -> type of corresponding assignment expression
        if ($expr instanceof Node\Expression\Variable || $expr instanceof Node\UseVariableName) {
            if ($expr->getName() === 'this') {
                return new Types\Object_(new Fqsen('\\' . $this->getContainingClassFqn($expr)));
            }
            // Find variable definition (parameter or assignment expression)
            $defNode = $this->resolveVariableToNode($expr);
            if ($defNode instanceof Node\Expression\AssignmentExpression || $defNode instanceof Node\UseVariableName) {
                return $this->resolveExpressionNodeToType($defNode);
            }
            if ($defNode instanceof Node\ForeachKey || $defNode instanceof Node\ForeachValue) {
                return $this->getTypeFromNode($defNode);
            }
            if ($defNode instanceof Node\Parameter) {
                return $this->getTypeFromNode($defNode);
            }
        }

        // FUNCTION CALL
        // Function calls are resolved to type corresponding to their FQN
        if ($expr instanceof Node\Expression\CallExpression &&
            !(
                $expr->callableExpression instanceof Node\Expression\ScopedPropertyAccessExpression ||
                $expr->callableExpression instanceof Node\Expression\MemberAccessExpression)
        ) {
            // Find the function definition
            if ($expr->callableExpression instanceof Node\Expression) {
                // Cannot get type for dynamic function call
                return new Types\Mixed_;
            }

            if ($expr->callableExpression instanceof Node\QualifiedName) {
                $fqn = $expr->callableExpression->getResolvedName() ?? $expr->callableExpression->getNamespacedName();
                $fqn .= '()';
                $def = $this->index->getDefinition($fqn, true);
                if ($def !== null) {
                    return $def->type;
                }
            }
        }

        // TRUE / FALSE / NULL
        // Resolve true and false reserved words to Types\Boolean
        if ($expr instanceof Node\ReservedWord) {
            $token = $expr->children->kind;
            if ($token === PhpParser\TokenKind::TrueReservedWord || $token === PhpParser\TokenKind::FalseReservedWord) {
                return new Types\Boolean;
            }

            if ($token === PhpParser\TokenKind::NullReservedWord) {
                return new Types\Null_;
            }
        }

        // CONSTANT FETCH
        // Resolve constants by retrieving corresponding definition type from FQN
        if (ParserHelpers\isConstantFetch($expr)) {
            $fqn = (string)$expr->getNamespacedName();
            $def = $this->index->getDefinition($fqn, true);
            if ($def !== null) {
                return $def->type;
            }
        }

        // MEMBER CALL EXPRESSION/SCOPED PROPERTY CALL EXPRESSION
        //   The type of the member/scoped property call expression is the type of the method, so resolve the
        //   type of the callable expression.
        if ($expr instanceof Node\Expression\CallExpression && (
            $expr->callableExpression instanceof Node\Expression\MemberAccessExpression ||
            $expr->callableExpression instanceof Node\Expression\ScopedPropertyAccessExpression)
        ) {
            return $this->resolveExpressionNodeToType($expr->callableExpression);
        }

        // MEMBER ACCESS EXPRESSION
        if ($expr instanceof Node\Expression\MemberAccessExpression) {
            if ($expr->memberName instanceof Node\Expression) {
                return new Types\Mixed_;
            }
            $var = $expr->dereferencableExpression;

           // Resolve object
            $objType = $this->resolveExpressionNodeToType($var);
            if (!($objType instanceof Types\Compound)) {
                $objType = new Types\Compound([$objType]);
            }
            for ($i = 0; $t = $objType->get($i); $i++) {
                if ($t instanceof Types\This) {
                    $classFqn = self::getContainingClassFqn($expr);
                    if ($classFqn === null) {
                        return new Types\Mixed_;
                    }
                } else if (!($t instanceof Types\Object_) || $t->getFqsen() === null) {
                    return new Types\Mixed_;
                } else {
                    $classFqn = substr((string)$t->getFqsen(), 1);
                }
                $add = '->' . $expr->memberName->getText($expr->getFileContents());
                if ($expr->parent instanceof Node\Expression\CallExpression) {
                    $add .= '()';
                }
                $classDef = $this->index->getDefinition($classFqn);
                if ($classDef !== null) {
                    foreach ($classDef->getAncestorDefinitions($this->index, true) as $fqn => $def) {
                        $def = $this->index->getDefinition($fqn . $add);
                        if ($def !== null) {
                            if ($def->type instanceof Types\This || $def->type instanceof Types\Self_) {
                                return new Types\Object_(new Fqsen('\\' . $classFqn));
                            }
                            return $def->type;
                        }
                    }
                }
            }
        }

        // SCOPED PROPERTY ACCESS EXPRESSION
        if ($expr instanceof Node\Expression\ScopedPropertyAccessExpression) {
            $classType = $this->resolveClassNameToType($expr->scopeResolutionQualifier);
            if (!($classType instanceof Types\Object_) || $classType->getFqsen() === null) {
                return new Types\Mixed_;
            }
            $fqn = substr((string)$classType->getFqsen(), 1) . '::';

            // TODO is there a cleaner way to do this?
            $fqn .= $expr->memberName->getText() ?? $expr->memberName->getText($expr->getFileContents());
            if ($expr->parent instanceof Node\Expression\CallExpression) {
                $fqn .= '()';
            }

            $def = $this->index->getDefinition($fqn);
            if ($def === null) {
                return new Types\Mixed_;
            }
            return $def->type;
        }

        // OBJECT CREATION EXPRESSION
        //   new A() => resolves to the type of the class type designator (A)
        //   TODO: new $this->a => resolves to the string represented by "a"
        if ($expr instanceof Node\Expression\ObjectCreationExpression) {
            return $this->resolveClassNameToType($expr->classTypeDesignator);
        }

        // CLONE EXPRESSION
        //   clone($a) => resolves to the type of $a
        if ($expr instanceof Node\Expression\CloneExpression) {
            return $this->resolveExpressionNodeToType($expr->expression);
        }

        // ASSIGNMENT EXPRESSION
        //   $a = $myExpression => resolves to the type of the right-hand operand
        if ($expr instanceof Node\Expression\AssignmentExpression) {
            return $this->resolveExpressionNodeToType($expr->rightOperand);
        }

        // TERNARY EXPRESSION
        //   $condition ? $ifExpression : $elseExpression => reslves to type of $ifCondition or $elseExpression
        //   $condition ?: $elseExpression => resolves to type of $condition or $elseExpression
        if ($expr instanceof Node\Expression\TernaryExpression) {
            // ?:
            if ($expr->ifExpression === null) {
                return new Types\Compound([
                    $this->resolveExpressionNodeToType($expr->condition), // TODO: why?
                    $this->resolveExpressionNodeToType($expr->elseExpression)
                ]);
            }
            // Ternary is a compound of the two possible values
            return new Types\Compound([
                $this->resolveExpressionNodeToType($expr->ifExpression),
                $this->resolveExpressionNodeToType($expr->elseExpression)
            ]);
        }

        // NULL COALLESCE
        //   $rightOperand ?? $leftOperand => resolves to type of $rightOperand or $leftOperand
        if ($expr instanceof Node\Expression\BinaryExpression && $expr->operator->kind === PhpParser\TokenKind::QuestionQuestionToken) {
            // ?? operator
            return new Types\Compound([
                $this->resolveExpressionNodeToType($expr->leftOperand),
                $this->resolveExpressionNodeToType($expr->rightOperand)
            ]);
        }

        // BOOLEAN EXPRESSIONS: resolve to Types\Boolean
        //   (bool) $expression
        //   !$expression
        //   empty($var)
        //   isset($var)
        //   >, >=, <, <=, &&, ||, AND, OR, XOR, ==, ===, !=, !==
        if (
            ParserHelpers\isBooleanExpression($expr)

            || ($expr instanceof Node\Expression\CastExpression && $expr->castType->kind === PhpParser\TokenKind::BoolCastToken)
            || ($expr instanceof Node\Expression\UnaryOpExpression && $expr->operator->kind === PhpParser\TokenKind::ExclamationToken)
            || $expr instanceof Node\Expression\EmptyIntrinsicExpression
            || $expr instanceof Node\Expression\IssetIntrinsicExpression
        ) {
            return new Types\Boolean;
        }

        // STRING EXPRESSIONS: resolve to Types\String
        //   [concatenation] .=, .
        //   [literals] "hello", \b"hello", \B"hello", 'hello', \b'hello', HEREDOC, NOWDOC
        //   [cast] (string) "hello"
        //
        //   TODO: Magic constants (__CLASS__, __DIR__, __FUNCTION__, __METHOD__, __NAMESPACE__, __TRAIT__, __FILE__)
        if (
            ($expr instanceof Node\Expression\BinaryExpression &&
                ($expr->operator->kind === PhpParser\TokenKind::DotToken || $expr->operator->kind === PhpParser\TokenKind::DotEqualsToken)) ||
            $expr instanceof Node\StringLiteral ||
            ($expr instanceof Node\Expression\CastExpression && $expr->castType->kind === PhpParser\TokenKind::StringCastToken)
        ) {
            return new Types\String_;
        }

        // BINARY EXPRESSIONS:
        // Resolve to Types\Integer if both left and right operands are integer types, otherwise Types\Float
        //   [operator] +, -, *, **
        //   [assignment] *=, **=, -=, +=
        // Resolve to Types\Float
        //   [assignment] /=
        if (
            $expr instanceof Node\Expression\BinaryExpression &&
            ($operator = $expr->operator->kind)
            && ($operator === PhpParser\TokenKind::PlusToken ||
                $operator === PhpParser\TokenKind::AsteriskAsteriskToken ||
                $operator === PhpParser\TokenKind::AsteriskToken ||
                $operator === PhpParser\TokenKind::MinusToken ||

                // Assignment expressions (TODO: consider making this a type of AssignmentExpression rather than kind of BinaryExpression)
                $operator === PhpParser\TokenKind::AsteriskEqualsToken||
                $operator === PhpParser\TokenKind::AsteriskAsteriskEqualsToken ||
                $operator === PhpParser\TokenKind::MinusEqualsToken ||
                $operator === PhpParser\TokenKind::PlusEqualsToken
            )
        ) {
            if (
                $this->resolveExpressionNodeToType($expr->leftOperand) instanceof Types\Integer
                && $this->resolveExpressionNodeToType($expr->rightOperand) instanceof Types\Integer
            ) {
                return new Types\Integer;
            }
            return new Types\Float_;
        } else if (
            $expr instanceof Node\Expression\BinaryExpression &&
            $expr->operator->kind === PhpParser\TokenKind::SlashEqualsToken
        ) {
            return new Types\Float_;
        }

        // INTEGER EXPRESSIONS: resolve to Types\Integer
        //   [literal] 1
        //   [operator] <=>, &, ^, |
        //   TODO: Magic constants (__LINE__)
        if (
            // TODO: consider different Node types of float/int, also better property name (not "children")
            ($expr instanceof Node\NumericLiteral && $expr->children->kind === PhpParser\TokenKind::IntegerLiteralToken) ||
            $expr instanceof Node\Expression\BinaryExpression && (
                ($operator = $expr->operator->kind)
                && ($operator === PhpParser\TokenKind::LessThanEqualsGreaterThanToken ||
                    $operator === PhpParser\TokenKind::AmpersandToken ||
                    $operator === PhpParser\TokenKind::CaretToken ||
                    $operator === PhpParser\TokenKind::BarToken)
            )
        ) {
            return new Types\Integer;
        }

        // FLOAT EXPRESSIONS: resolve to Types\Float
        //   [literal] 1.5
        //   [operator] /
        //   [cast] (double)
        if (
            $expr instanceof Node\NumericLiteral && $expr->children->kind === PhpParser\TokenKind::FloatingLiteralToken ||
            ($expr instanceof Node\Expression\CastExpression && $expr->castType->kind === PhpParser\TokenKind::DoubleCastToken) ||
            ($expr instanceof Node\Expression\BinaryExpression && $expr->operator->kind === PhpParser\TokenKind::SlashToken)
        ) {
            return new Types\Float_;
        }

        // ARRAY CREATION EXPRESSION:
        // Resolve to Types\Array (Types\Compound of value and key types)
        //  [a, b, c]
        //  [1=>"hello", "hi"=>1, 4=>[]]s
        if ($expr instanceof Node\Expression\ArrayCreationExpression) {
            $valueTypes = [];
            $keyTypes = [];
            if ($expr->arrayElements !== null) {
                foreach ($expr->arrayElements->getElements() as $item) {
                    $valueTypes[] = $this->resolveExpressionNodeToType($item->elementValue);
                    $keyTypes[] = $item->elementKey ? $this->resolveExpressionNodeToType($item->elementKey) : new Types\Integer;
                }
            }
            $valueTypes = array_unique($valueTypes);
            $keyTypes = array_unique($keyTypes);
            if (empty($valueTypes)) {
                $valueType = null;
            } else if (count($valueTypes) === 1) {
                $valueType = $valueTypes[0];
            } else {
                $valueType = new Types\Compound($valueTypes);
            }
            if (empty($keyTypes)) {
                $keyType = null;
            } else if (count($keyTypes) === 1) {
                $keyType = $keyTypes[0];
            } else {
                $keyType = new Types\Compound($keyTypes);
            }
            return new Types\Array_($valueType, $keyType);
        }

        // SUBSCRIPT EXPRESSION
        // $myArray[3]
        // $myArray{"hello"}
        if ($expr instanceof Node\Expression\SubscriptExpression) {
            $varType = $this->resolveExpressionNodeToType($expr->postfixExpression);
            if (!($varType instanceof Types\Array_)) {
                return new Types\Mixed_;
            }
            return $varType->getValueType();
        }

        // SCRIPT INCLUSION EXPRESSION
        //   include, require, include_once, require_once
        if ($expr instanceof Node\Expression\ScriptInclusionExpression) {
            // TODO: resolve path to PhpDocument and find return statement
            return new Types\Mixed_;
        }

        if ($expr instanceof Node\QualifiedName) {
            return $this->resolveClassNameToType($expr);
        }

        return new Types\Mixed_;
    }
646721
public function current()
    {
        $token = parent::current();
        $offset = $this->key();
        $before = isset($this[$offset - 1])
                ? $this[$offset - 1]
                : null;

        // is it an unused token?
        if (false === self::$sequences[$token[0]]) {
            throw UnexpectedTokenException::create(
                'Token #%d (%d) is not used by this library.',
                $offset,
                $token[0]
            );

            // not in the list of expected tokens?
        } elseif ((empty($before) && (DocLexer::T_AT !== $token[0]))
            || ($before && !isset(self::$sequences[$token[0]][$before[0]]))) {
            throw UnexpectedTokenException::create(
                'Token #%d (%d) is not expected here.',
                $offset,
                $token[0]
            );

            // before token has another before requirement?
        } elseif (isset(self::$sequences[$token[0]][$before[0]])
            && (true !== self::$sequences[$token[0]][$before[0]])) {
            $ancestor = isset($this[$offset - 2])
                      ? $this[$offset - 2]
                      : null;

            if (!$ancestor
                || ($ancestor[0] !== self::$sequences[$token[0]][$before[0]])) {
                throw UnexpectedTokenException::create(
                    'Token #%d (%d) is not expected here.',
                    $offset,
                    $token[0]
                );
            }
        }

        return $token;
    }
1327247
public static function conversionFailedFormat($value, $toType, $expectedFormat, ?Throwable $previous = null)
    {
        $value = strlen($value) > 32 ? substr($value, 0, 20) . '...' : $value;

        return new self(
            'Could not convert database value "' . $value . '" to Doctrine Type ' .
            $toType . '. Expected format: ' . $expectedFormat,
            0,
            $previous
        );
    }
1000499
Expression XreadBooleanPrimaryOrNull() {

        Expression e = null;
        int        position;

        switch (token.tokenType) {

            case Tokens.EXISTS :
            case Tokens.UNIQUE :
                return XreadPredicate();

            case Tokens.ROW :
                read();
                readThis(Tokens.OPENBRACKET);

                e = XreadRowElementList(true);

                readThis(Tokens.CLOSEBRACKET);
                break;

            default :
                position = getPosition();

                try {
                    e = XreadAllTypesCommonValueExpression(false);
                } catch (HsqlException ex) {
                    ex.setLevel(compileContext.subQueryDepth);

                    if (lastError == null
                            || lastError.getLevel() < ex.getLevel()) {
                        lastError = ex;
                    }

                    rewind(position);
                }
        }

        if (e == null && token.tokenType == Tokens.OPENBRACKET) {
            read();

            position = getPosition();

            try {
                e = XreadRowElementList(true);

                readThis(Tokens.CLOSEBRACKET);
            } catch (HsqlException ex) {
                ex.setLevel(compileContext.subQueryDepth);

                if (lastError == null
                        || lastError.getLevel() < ex.getLevel()) {
                    lastError = ex;
                }

                rewind(position);

                e = XreadBooleanValueExpression();

                readThis(Tokens.CLOSEBRACKET);
            }
        }

        if (e != null) {
            e = XreadPredicateRightPart(e);
        }

        return e;
    }
1022191
public function preProcessExpression(Expression $expression)
    {
        $expression = $this->completeExpression($expression);
        
        if ($this->isParameterized() && ($expression instanceof Expr\Parameter)) {
            
            $placeholder = $this->getPlaceholderForExpression($expression);
            if (null === $placeholder) {
                $placeholder = new Expr\Raw(':p' . $this->parameterCounter++);
                $this->setPlaceholder($expression->hashCode(), $placeholder);
            }
            
            return $placeholder;
        }
        
        return $expression;
    }
932691
public function parseDelimiter()
    {
        $idx = 0;

        while ($idx < $this->delimiterLen && $this->last + $idx < $this->len) {
            if ($this->delimiter[$idx] !== $this->str[$this->last + $idx]) {
                return null;
            }
            ++$idx;
        }

        $this->last += $this->delimiterLen - 1;

        return new Token($this->delimiter, Token::TYPE_DELIMITER);
    }
654059
protected function matchCurrentPathPart($pathPart, $previousConfiguration, &$currentPrototypeDefinitions)
    {
        if (preg_match('#^([^<]*)(<(.*?)>)?$#', $pathPart, $matches) !== 1) {
            throw new Exception('Path Part ' . $pathPart . ' not well-formed', 1332494645);
        }

        $currentPathSegment = $matches[1];
        $configuration = [];

        if (isset($previousConfiguration[$currentPathSegment])) {
            $configuration = is_array($previousConfiguration[$currentPathSegment]) ? $previousConfiguration[$currentPathSegment] : $this->simpleTypeToArrayClosure->__invoke($previousConfiguration[$currentPathSegment]);
        }

        if (isset($configuration['__prototypes'])) {
            $currentPrototypeDefinitions = Arrays::arrayMergeRecursiveOverruleWithCallback($currentPrototypeDefinitions, $configuration['__prototypes'], $this->simpleTypeToArrayClosure);
        }

        $currentPathSegmentType = null;
        if (isset($configuration['__objectType'])) {
            $currentPathSegmentType = $configuration['__objectType'];
        }
        if (isset($matches[3])) {
            $currentPathSegmentType = $matches[3];
        }

        if ($currentPathSegmentType !== null) {
            $configuration['__objectType'] = $currentPathSegmentType;
            $configuration = $this->mergePrototypesWithConfigurationForPathSegment($configuration, $currentPrototypeDefinitions);
        }

        if (is_array($configuration) && !isset($configuration['__value']) && !isset($configuration['__eelExpression']) && !isset($configuration['__meta']['class']) && !isset($configuration['__objectType']) && isset($configuration['__meta']['process'])) {
            $configuration['__value'] = '';
        }

        return $configuration;
    }
1124298
public static function fromArray(array $method, ?Throwable $previous = null): self
    {
        $className = get_class($method[0]);
        $methodName = $method[1];

        $method = sprintf('%s::%s', $className, $methodName);

        return self::make($method, $previous);
    }