@param string      $statement
@param string      $code
@param string|null $condition
@param string|null $next
@param bool        $newLine

@return string
486918
public function renderStatement($statement, $code, $condition = null, $next = null, $newLine = true)
    {
        $separator = $this->renderSeparator();
        $statement .= $separator;

        if (!empty($condition)) {
            $statement .= $this->renderArguments([$condition]).$separator;
        }

        if (!empty($next)) {
            $next = $separator.$next;
        }

        return $this->renderLines([
            $statement.'{',
            $this->renderIndentation($code),
            '}'.$next,
        ], true, $newLine);
    }
6758
public static function analyze(
        StatementsAnalyzer $statements_analyzer,
        PhpParser\Node\Stmt\Foreach_ $stmt,
        Context $context
    ) {
        $var_comments = [];

        $doc_comment_text = (string)$stmt->getDocComment();

        $codebase = $statements_analyzer->getCodebase();

        if ($doc_comment_text) {
            try {
                $var_comments = CommentAnalyzer::getTypeFromComment(
                    $doc_comment_text,
                    $statements_analyzer->getSource(),
                    $statements_analyzer->getSource()->getAliases()
                );
            } catch (DocblockParseException $e) {
                if (IssueBuffer::accepts(
                    new InvalidDocblock(
                        (string)$e->getMessage(),
                        new CodeLocation($statements_analyzer, $stmt)
                    )
                )) {
                    // fall through
                }
            }
        }

        $safe_var_ids = [];

        if ($stmt->keyVar instanceof PhpParser\Node\Expr\Variable && is_string($stmt->keyVar->name)) {
            $safe_var_ids['$' . $stmt->keyVar->name] = true;
        }

        if ($stmt->valueVar instanceof PhpParser\Node\Expr\Variable && is_string($stmt->valueVar->name)) {
            $safe_var_ids['$' . $stmt->valueVar->name] = true;
        } elseif ($stmt->valueVar instanceof PhpParser\Node\Expr\List_) {
            foreach ($stmt->valueVar->items as $list_item) {
                if (!$list_item) {
                    continue;
                }

                $list_item_key = $list_item->key;
                $list_item_value = $list_item->value;

                if ($list_item_value instanceof PhpParser\Node\Expr\Variable && is_string($list_item_value->name)) {
                    $safe_var_ids['$' . $list_item_value->name] = true;
                }

                if ($list_item_key instanceof PhpParser\Node\Expr\Variable && is_string($list_item_key->name)) {
                    $safe_var_ids['$' . $list_item_key->name] = true;
                }
            }
        }

        foreach ($var_comments as $var_comment) {
            if (!$var_comment->var_id) {
                continue;
            }

            if (isset($safe_var_ids[$var_comment->var_id])) {
                continue;
            }

            $comment_type = ExpressionAnalyzer::fleshOutType(
                $codebase,
                $var_comment->type,
                $context->self,
                $context->self
            );

            if (isset($context->vars_in_scope[$var_comment->var_id])
                || $statements_analyzer->isSuperGlobal($var_comment->var_id)
            ) {
                $context->vars_in_scope[$var_comment->var_id] = $comment_type;
            }
        }

        if (ExpressionAnalyzer::analyze($statements_analyzer, $stmt->expr, $context) === false) {
            return false;
        }

        $key_type = null;
        $value_type = null;
        $always_non_empty_array = true;

        $var_id = ExpressionAnalyzer::getVarId(
            $stmt->expr,
            $statements_analyzer->getFQCLN(),
            $statements_analyzer
        );

        if (isset($stmt->expr->inferredType)) {
            $iterator_type = $stmt->expr->inferredType;
        } elseif ($var_id && $context->hasVariable($var_id, $statements_analyzer)) {
            $iterator_type = $context->vars_in_scope[$var_id];
        } else {
            $iterator_type = null;
        }

        if ($iterator_type) {
            if (self::checkIteratorType(
                $statements_analyzer,
                $stmt,
                $iterator_type,
                $codebase,
                $context,
                $key_type,
                $value_type,
                $always_non_empty_array
            ) === false
            ) {
                return false;
            }
        }

        $foreach_context = clone $context;

        $foreach_context->inside_loop = true;
        $foreach_context->inside_case = false;

        if ($codebase->alter_code) {
            $foreach_context->branch_point =
                $foreach_context->branch_point ?: (int) $stmt->getAttribute('startFilePos');
        }

        if ($stmt->keyVar && $stmt->keyVar instanceof PhpParser\Node\Expr\Variable && is_string($stmt->keyVar->name)) {
            $key_var_id = '$' . $stmt->keyVar->name;
            $foreach_context->vars_in_scope[$key_var_id] = $key_type ?: Type::getMixed();
            $foreach_context->vars_possibly_in_scope[$key_var_id] = true;

            $location = new CodeLocation($statements_analyzer, $stmt->keyVar);

            if ($context->collect_references && !isset($foreach_context->byref_constraints[$key_var_id])) {
                $foreach_context->unreferenced_vars[$key_var_id] = [$location->getHash() => $location];
            }

            if (!$statements_analyzer->hasVariable($key_var_id)) {
                $statements_analyzer->registerVariable(
                    $key_var_id,
                    $location,
                    $foreach_context->branch_point
                );
            } else {
                $statements_analyzer->registerVariableAssignment(
                    $key_var_id,
                    $location
                );
            }

            if ($stmt->byRef && $context->collect_references) {
                $statements_analyzer->registerVariableUses([$location->getHash() => $location]);
            }
        }

        if ($context->collect_references
            && $stmt->byRef
            && $stmt->valueVar instanceof PhpParser\Node\Expr\Variable
            && is_string($stmt->valueVar->name)
        ) {
            $foreach_context->byref_constraints['$' . $stmt->valueVar->name]
                = new \Psalm\Internal\ReferenceConstraint($value_type);
        }

        AssignmentAnalyzer::analyze(
            $statements_analyzer,
            $stmt->valueVar,
            null,
            $value_type ?: Type::getMixed(),
            $foreach_context,
            $doc_comment_text
        );

        foreach ($var_comments as $var_comment) {
            if (!$var_comment->var_id) {
                continue;
            }

            $comment_type = ExpressionAnalyzer::fleshOutType(
                $codebase,
                $var_comment->type,
                $context->self,
                $context->self
            );

            $foreach_context->vars_in_scope[$var_comment->var_id] = $comment_type;
        }

        $loop_scope = new LoopScope($foreach_context, $context);

        $protected_var_ids = $context->protected_var_ids;
        if ($var_id) {
            $protected_var_ids[$var_id] = true;
        }
        $loop_scope->protected_var_ids = $protected_var_ids;

        LoopAnalyzer::analyze($statements_analyzer, $stmt->stmts, [], [], $loop_scope, $inner_loop_context);

        if (!$inner_loop_context) {
            throw new \UnexpectedValueException('There should be an inner loop context');
        }

        if ($always_non_empty_array) {
            foreach ($inner_loop_context->vars_in_scope as $var_id => $type) {
                // if there are break statements in the loop it's not certain
                // that the loop has finished executing, so the assertions at the end
                // the loop in the while conditional may not hold
                if (in_array(ScopeAnalyzer::ACTION_BREAK, $loop_scope->final_actions, true)
                    || in_array(ScopeAnalyzer::ACTION_CONTINUE, $loop_scope->final_actions, true)
                ) {
                    if (isset($loop_scope->possibly_defined_loop_parent_vars[$var_id])) {
                        $context->vars_in_scope[$var_id] = Type::combineUnionTypes(
                            $type,
                            $loop_scope->possibly_defined_loop_parent_vars[$var_id]
                        );
                    }
                } else {
                    $context->vars_in_scope[$var_id] = $type;
                }
            }
        }

        $foreach_context->loop_scope = null;

        $context->vars_possibly_in_scope = array_merge(
            $foreach_context->vars_possibly_in_scope,
            $context->vars_possibly_in_scope
        );

        $context->referenced_var_ids = array_merge(
            $foreach_context->referenced_var_ids,
            $context->referenced_var_ids
        );

        if ($context->collect_exceptions) {
            $context->mergeExceptions($foreach_context);
        }

        if ($context->collect_references) {
            foreach ($foreach_context->unreferenced_vars as $var_id => $locations) {
                if (isset($context->unreferenced_vars[$var_id])) {
                    $context->unreferenced_vars[$var_id] += $locations;
                } else {
                    $context->unreferenced_vars[$var_id] = $locations;
                }
            }
        }

        return null;
    }
187558
protected function lexPunctuation(int $code, int $line, int $column, Token $prev): ?Token
    {
        if (!isset(self::$codeTokenKindMap[$code])) {
            throw $this->createSyntaxErrorException();
        }

        return new Token(self::$codeTokenKindMap[$code], $this->position, $this->position + 1, $line, $column, $prev);
    }
116175
public function prepare($statement)
    {
	
        $returnValue = null;
        $this->preparedExec = false;
        $returnValue = $this->getStatement($statement);

		
        return $returnValue;
    }
236201
protected function html($newLine, $condition = true)
    {
        if ($condition) {
            $this->lines[] = ltrim($newLine);
        }
        return $this;
    }
186130
public function query($statement) {
		try {
			$stmt = $this->pdo->query($statement);
			return new QueryResult($stmt, $this->pdo);
		} catch (PDOException $e) {
			throw $this->exceptionAdapter->adapt($e, $statement);
		}
	}
1935
public function query($statement, $params = array())
    {
        $returnValue = null;

        
//         $trace=debug_backtrace();
//         $caller=array_shift($trace);
//         $caller=array_shift($trace);
//         common_Logger::d('trace : '. $caller['function'] .$caller['class'] );
//         common_Logger::d($statement . implode('|', $params));
       	$sth = $this->persistence->query($statement,$params);
		
        if (!empty($sth)){
        	$returnValue = $sth;
        }

        $this->incrementNrOfQueries();
        return $returnValue;
    }
997424
public function getSingleResult($statement, $params = array())
    {
        $result = $this->getResults($statement, $params);

        if (!sizeof($result)) {
            return null;
        }

        return $result[0];
    }
444064
public final BELStatementParser.statement_return statement() throws RecognitionException {
        BELStatementParser.statement_return retval = new BELStatementParser.statement_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token OPEN_PAREN1=null;
        Token CLOSE_PAREN2=null;
        BELStatementParser.outer_term_return st = null;

        BELStatementParser.relationship_return rel = null;

        BELStatementParser.outer_term_return nst = null;

        BELStatementParser.relationship_return nrel = null;

        BELStatementParser.outer_term_return not = null;

        BELStatementParser.outer_term_return ot = null;


        Object OPEN_PAREN1_tree=null;
        Object CLOSE_PAREN2_tree=null;

        try {
            // BELStatement.g:64:32: (st= outer_term (rel= relationship ( ( OPEN_PAREN nst= outer_term nrel= relationship not= outer_term CLOSE_PAREN ) | ot= outer_term ) )? )
            // BELStatement.g:65:5: st= outer_term (rel= relationship ( ( OPEN_PAREN nst= outer_term nrel= relationship not= outer_term CLOSE_PAREN ) | ot= outer_term ) )?
            {
            root_0 = (Object)adaptor.nil();

            pushFollow(FOLLOW_outer_term_in_statement81);
            st=outer_term();

            state._fsp--;

            adaptor.addChild(root_0, st.getTree());

                    final Statement s = new Statement((st!=null?st.r:null));
                    retval.r = s;
                
            // BELStatement.g:69:5: (rel= relationship ( ( OPEN_PAREN nst= outer_term nrel= relationship not= outer_term CLOSE_PAREN ) | ot= outer_term ) )?
            int alt2=2;
            int LA2_0 = input.LA(1);

            if ( ((LA2_0>=76 && LA2_0<=103)) ) {
                alt2=1;
            }
            switch (alt2) {
                case 1 :
                    // BELStatement.g:70:9: rel= relationship ( ( OPEN_PAREN nst= outer_term nrel= relationship not= outer_term CLOSE_PAREN ) | ot= outer_term )
                    {
                    pushFollow(FOLLOW_relationship_in_statement101);
                    rel=relationship();

                    state._fsp--;

                    adaptor.addChild(root_0, rel.getTree());

                                s.setRelationshipType((rel!=null?rel.r:null));
                            
                    // BELStatement.g:73:9: ( ( OPEN_PAREN nst= outer_term nrel= relationship not= outer_term CLOSE_PAREN ) | ot= outer_term )
                    int alt1=2;
                    int LA1_0 = input.LA(1);

                    if ( (LA1_0==OPEN_PAREN) ) {
                        alt1=1;
                    }
                    else if ( ((LA1_0>=17 && LA1_0<=75)) ) {
                        alt1=2;
                    }
                    else {
                        NoViableAltException nvae =
                            new NoViableAltException("", 1, 0, input);

                        throw nvae;
                    }
                    switch (alt1) {
                        case 1 :
                            // BELStatement.g:74:13: ( OPEN_PAREN nst= outer_term nrel= relationship not= outer_term CLOSE_PAREN )
                            {
                            // BELStatement.g:74:13: ( OPEN_PAREN nst= outer_term nrel= relationship not= outer_term CLOSE_PAREN )
                            // BELStatement.g:75:17: OPEN_PAREN nst= outer_term nrel= relationship not= outer_term CLOSE_PAREN
                            {
                            OPEN_PAREN1=(Token)match(input,OPEN_PAREN,FOLLOW_OPEN_PAREN_in_statement145); 
                            OPEN_PAREN1_tree = (Object)adaptor.create(OPEN_PAREN1);
                            adaptor.addChild(root_0, OPEN_PAREN1_tree);

                            pushFollow(FOLLOW_outer_term_in_statement166);
                            nst=outer_term();

                            state._fsp--;

                            adaptor.addChild(root_0, nst.getTree());

                                                final Statement ns = new Statement((nst!=null?nst.r:null));
                                            
                            pushFollow(FOLLOW_relationship_in_statement188);
                            nrel=relationship();

                            state._fsp--;

                            adaptor.addChild(root_0, nrel.getTree());

                                                ns.setRelationshipType((nrel!=null?nrel.r:null));
                                            
                            pushFollow(FOLLOW_outer_term_in_statement211);
                            not=outer_term();

                            state._fsp--;

                            adaptor.addChild(root_0, not.getTree());

                                                ns.setObject(new Statement.Object((not!=null?not.r:null)));
                                                s.setObject(new Statement.Object(ns));
                                                retval.r = s;
                                            
                            CLOSE_PAREN2=(Token)match(input,CLOSE_PAREN,FOLLOW_CLOSE_PAREN_in_statement231); 
                            CLOSE_PAREN2_tree = (Object)adaptor.create(CLOSE_PAREN2);
                            adaptor.addChild(root_0, CLOSE_PAREN2_tree);


                            }


                            }
                            break;
                        case 2 :
                            // BELStatement.g:90:17: ot= outer_term
                            {
                            pushFollow(FOLLOW_outer_term_in_statement280);
                            ot=outer_term();

                            state._fsp--;

                            adaptor.addChild(root_0, ot.getTree());

                                                s.setObject(new Statement.Object((ot!=null?ot.r:null)));
                                                retval.r = s;
                                            

                            }
                            break;

                    }


                    }
                    break;

            }


            }

            retval.stop = input.LT(-1);

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
697747
protected function _put($s, $newLine = true)
    {
        if ($newLine) {
            $this->setBuffer($s . "\n");
        } else {
            $this->setBuffer($s);
        }
    }
659433
public function exec($statement)
    {
        $result = $this->mysqli->query($statement);

        if ($result === false) {
            throw new MysqliException($this->mysqli->error, $this->mysqli->errno);
        }

        return $this->mysqli->affected_rows;
    }
841656
protected function append($statement, $pos = null)
    {
        if ($pos !== null) {
            list($line, $column) = $this->getSourcePosition($pos);

            $statement[static::SOURCE_LINE]   = $line;
            $statement[static::SOURCE_COLUMN] = $column;
            $statement[static::SOURCE_INDEX]  = $this->sourceIndex;
        }

        $this->env->children[] = $statement;

        $comments = $this->env->comments;

        if (count($comments)) {
            $this->env->children = array_merge($this->env->children, $comments);
            $this->env->comments = [];
        }
    }
1101848
public function query($statement, $mode=null, $p1=null, $p2=null)
    {
        // TODO: use mode and parameters
        $stmt = null;
        try {
            $stmt = new Statement($this, $statement);
            $stmt->execute();
            $this->setError();
            return $stmt;
        } catch (\Exception $e) {
            throw new \PDOException($e->getMessage());
        }
        return $stmt;
    }
295311
public static function Q($str, $mode = 'strict', $newlines = true)
    {
        return rcube_utils::rep_specialchars_output($str, 'html', $mode, $newlines);
    }
835689
public static function afterExpressionAnalysis(
        PhpParser\Node\Expr $expr,
        Context $context,
        StatementsSource $statements_source,
        Codebase $codebase,
        array &$file_replacements = []
    ) {
        if ($expr instanceof PhpParser\Node\Scalar\String_) {
            $class_or_class_method = '/^\\\?Psalm(\\\[A-Z][A-Za-z0-9]+)+(::[A-Za-z0-9]+)?$/';

            if (strpos($statements_source->getFileName(), 'base/DefinitionManager.php') === false
                && strpos($expr->value, 'TestController') === false
                && preg_match($class_or_class_method, $expr->value)
            ) {
                $absolute_class = preg_split('/[:]/', $expr->value)[0];

                if (\Psalm\IssueBuffer::accepts(
                    new \Psalm\Issue\InvalidClass(
                        'Use ::class constants when representing class names',
                        new CodeLocation($statements_source, $expr),
                        $absolute_class
                    ),
                    $statements_source->getSuppressedIssues()
                )) {
                    // fall through
                }
            }
        } elseif ($expr instanceof PhpParser\Node\Expr\BinaryOp\Concat
            && $expr->left instanceof PhpParser\Node\Expr\ClassConstFetch
            && $expr->left->class instanceof PhpParser\Node\Name
            && $expr->left->name instanceof PhpParser\Node\Identifier
            && strtolower($expr->left->name->name) === 'class'
            && !in_array(strtolower($expr->left->class->parts[0]), ['self', 'static', 'parent'])
            && $expr->right instanceof PhpParser\Node\Scalar\String_
            && preg_match('/^::[A-Za-z0-9]+$/', $expr->right->value)
        ) {
            $method_id = ((string) $expr->left->class->getAttribute('resolvedName')) . $expr->right->value;

            $appearing_method_id = $codebase->getAppearingMethodId($method_id);

            if (!$appearing_method_id) {
                if (\Psalm\IssueBuffer::accepts(
                    new \Psalm\Issue\UndefinedMethod(
                        'Method ' . $method_id . ' does not exist',
                        new CodeLocation($statements_source, $expr),
                        $method_id
                    ),
                    $statements_source->getSuppressedIssues()
                )) {
                    return false;
                }

                return;
            }
        }
    }
933807
public function query($statement, $param1 = null, $param2 = null, $param3 = null)
    {
        if ($param3 !== null) {
            return $this->pdo->query($statement, $param1, $param2, $param3);
        }

        if ($param2 !== null) {
            return $this->pdo->query($statement, $param1, $param2);
        }

        if ($param1 !== null) {
            return $this->pdo->query($statement, $param1);
        }

        return $this->pdo->query($statement);
    }
1150004
public static function afterStatementAnalysis(
        PhpParser\Node\Stmt $stmt,
        Context $context,
        StatementsSource $statements_source,
        Codebase $codebase,
        array &$file_replacements = []
    ) {
        if ($stmt instanceof PhpParser\Node\Stmt\Echo_) {
            foreach ($stmt->exprs as $expr) {
                if (!isset($expr->inferredType) || $expr->inferredType->hasMixed()) {
                    if (IssueBuffer::accepts(
                        new ArgumentTypeCoercion(
                            'Echo requires an unescaped string, ' . $expr->inferredType . ' provided',
                            new CodeLocation($statements_source, $expr),
                            'echo'
                        ),
                        $statements_source->getSuppressedIssues()
                    )) {
                        // keep soldiering on
                    }

                    continue;
                }

                $types = $expr->inferredType->getTypes();

                foreach ($types as $type) {
                    if ($type instanceof \Psalm\Type\Atomic\TString
                        && !$type instanceof \Psalm\Type\Atomic\TLiteralString
                        && !$type instanceof \Psalm\Type\Atomic\THtmlEscapedString
                    ) {
                        if (IssueBuffer::accepts(
                            new ArgumentTypeCoercion(
                                'Echo requires an unescaped string, ' . $expr->inferredType . ' provided',
                                new CodeLocation($statements_source, $expr),
                                'echo'
                            ),
                            $statements_source->getSuppressedIssues()
                        )) {
                            // keep soldiering on
                        }
                    }
                }
            }
        }
    }