a PHPStan extension called phpstan-dba, which supports result-set type inference and sql syntax checking capabilites. Its really helpful to get your codebase type coverage improved from the ground up, as typically the database access apis are a big source of mixed types.Supports doctrine DBAL, PDO, mysqli with MySQL/MariaDB and PostgreSQL.
https://github.com/staabm/phpstan-dba