TysonAndre / phan

Phan is a static analyzer for PHP. Phan prefers to avoid false-positives and attempts to prove incorrectness rather than correctness.
Other
0 stars 0 forks source link

Idea: Create plugins which will type check SQL operations #125

Closed TysonAndre closed 6 years ago

TysonAndre commented 6 years ago

http://php.net/manual/en/pdo.exec.php

E.g. for $count = $dbh->exec("SELECT rating, name FROM fruit");

TysonAndre commented 6 years ago

https://github.com/phpmyadmin/sql-parser

TysonAndre commented 6 years ago

https://github.com/TysonAndre/PhanSQLPlugin is a WIP

Using Phan's @template support to override getRows() or addBindVars may be useful.

https://secure.php.net/manual/en/mysqli-stmt.bind-param.php and https://secure.php.net/manual/en/mysqli-stmt.bind-result.php may be possible to analyze.

Haven't investigated what the most common approach is (Symfony? ORMs?)