Exakat\Analyzer\Security\ShouldUsePreparedStatement::analyze PHP Метод

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

public analyze ( )
    public function analyze()
    {
        $functions = array('\\pg_query', '\\sqlsrv_query', '\\cubrid_query', '\\sqlite_query', '\\sybase_query', '\\ingres_query', '\\pg_send_query', '\\msql_db_query', '\\mysql_db_query', '\\fbsql_db_query', '\\pg_cancel_query', '\\ifx_query', '\\ibase_free_query', '\\dbx_query', '\\maxdb_multi_query', '\\sqlite_array_query', '\\mysqli_slave_query', '\\mysqli_master_query', '\\sqlite_single_query');
        // dynamic type in the code : mysql_query($res, "select ".$a." from table");
        $this->atomFunctionIs($functions)->outIs('ARGUMENTS')->outWithRank('ARGUMENT', 1)->atomIs('Concatenation')->back('first');
        $this->prepareQuery();
        // dynamic type in the code : mysql_query($res, "select $a from table");
        $this->atomFunctionIs($functions)->outIs('ARGUMENTS')->outWithRank('ARGUMENT', 1)->atomIs('String')->hasOut('CONCAT')->back('first');
        $this->prepareQuery();
        // dynamic type in the code : mysql_query($res, <<<HEREDOC select $a from table HEREDOC);
        $this->atomFunctionIs($functions)->outIs('ARGUMENTS')->outWithRank('ARGUMENT', 1)->atomIs('Heredoc')->is('heredoc', true)->hasOut('CONCAT')->back('first');
        $this->prepareQuery();
        // method call $someObject->query('select '. 'b') (probably too wide...)
        $this->atomIs('Methodcall')->outIs('METHOD')->codeIs('query')->outIs('ARGUMENTS')->outWithRank('ARGUMENT', 0)->atomIs('Concatenation')->back('first');
        $this->prepareQuery();
        // method call $someObject->query("select $b") (probably too wide...)
        $this->atomIs('Methodcall')->outIs('METHOD')->codeIs('query')->outIs('ARGUMENTS')->outWithRank('ARGUMENT', 0)->atomIs('String')->hasOut('CONCAT')->back('first');
        $this->prepareQuery();
        // dynamic type in the code : mysql_query($res, <<<HEREDOC select $a from table HEREDOC);
        $this->atomIs('Methodcall')->outIs('METHOD')->codeIs('query')->outIs('ARGUMENTS')->outWithRank('ARGUMENT', 1)->atomIs('Heredoc')->is('heredoc', true)->hasOut('CONCAT')->back('first');
        $this->prepareQuery();
    }
ShouldUsePreparedStatement