Exakat\Analyzer\Wordpress\WpdbPrepareOrNot::analyze PHP Метод

analyze() публичный Метод

public analyze ( )
    public function analyze()
    {
        // No variable, don't use prepare
        // $wpdb->prepare("insert into table values (1,2,3)")
        $this->atomIs('Variable')->codeIs('$wpdb')->inIs('OBJECT')->_as('results')->atomIs('Methodcall')->outIs('METHOD')->codeIs('prepare')->outIs('ARGUMENTS')->is('count', 1)->outWithRank('ARGUMENT', 0)->atomIs(array('String', 'Heredoc'))->hasNoOut('CONCAT')->back('results');
        $this->prepareQuery();
        // $wpdb->prepare("insert into $wpdb->prefix values (1,2,3)")
        $this->atomIs('Variable')->codeIs('$wpdb')->inIs('OBJECT')->_as('results')->atomIs('Methodcall')->outIs('METHOD')->codeIs('prepare')->outIs('ARGUMENTS')->outWithRank('ARGUMENT', 0)->atomIs('String')->tokenIs('T_QUOTE')->raw('where( __.out("CONCAT").hasLabel("Variable", "Array", "Property")
                             .where( __.out("OBJECT").has("code", "\\$wpdb").count().is(eq(0)) )
                             .count().is(eq(0)) )')->back('results');
        $this->prepareQuery();
        // $wpdb->prepare(<<<SQL insert into $wpdb->prefix values (1,2,3) SQL;)
        $this->atomIs('Variable')->codeIs('$wpdb')->inIs('OBJECT')->_as('results')->atomIs('Methodcall')->outIs('METHOD')->codeIs('prepare')->outIs('ARGUMENTS')->outWithRank('ARGUMENT', 0)->atomIs('Heredoc')->is('heredoc', true)->raw('where( __.out("CONCAT").hasLabel("Variable", "Array", "Property")
                             .where( __.out("OBJECT").has("code", "\\$wpdb").count().is(eq(0)) )
                             .count().is(neq(0)) )')->back('results');
        $this->prepareQuery();
        // $wpdb->prepare("insert into ".$wpdb->prefix." values (1,2,3)")
        $this->atomIs('Variable')->codeIs('$wpdb')->inIs('OBJECT')->_as('results')->atomIs('Methodcall')->outIs('METHOD')->codeIs('prepare')->outIs('ARGUMENTS')->outWithRank('ARGUMENT', 0)->atomIs('Concatenation')->raw('where( __.out("CONCAT").hasLabel("Variable", "Array", "Property")
                             .where( __.out("OBJECT").has("code", "\\$wpdb").count().is(eq(0)) )
                             .count().is(eq(0)) )')->outIs('CONCAT')->atomIs('String')->tokenIs('T_QUOTE')->raw('where( __.out("CONCAT").hasLabel("String").has("token", "T_QUOTE")
                             .out("CONCAT").hasLabel("Variable", "Array", "Property")
                             .where( __.out("OBJECT").has("code", "\\$wpdb").count().is(eq(0)) )
                             .count().is(eq(0)) )')->back('results');
        $this->prepareQuery();
    }
WpdbPrepareOrNot