@@ -55,8 +55,6 @@ use staabm\PHPStanDba\QueryReflection\ReflectionCache;
5555
5656require_once __DIR__ . '/vendor/autoload.php';
5757
58- $cacheFile = __DIR__.'/.phpstan-dba.cache';
59-
6058$config = new RuntimeConfiguration();
6159// $config->debugMode(true);
6260// $config->stringifyTypes(true);
@@ -65,17 +63,22 @@ $config = new RuntimeConfiguration();
6563
6664// TODO: Put your database credentials here
6765$mysqli = new mysqli('hostname', 'username', 'password', 'database');
66+ // Alternatively you can use PdoMysqlQueryReflector, PdoPgSqlQueryReflector instead
67+ $reflector = new MysqliQueryReflector($mysqli);
6868
69- QueryReflection::setupReflector(
70- new ReplayAndRecordingQueryReflector(
71- ReflectionCache::create(
72- $cacheFile
73- ),
74- // XXX alternatively you can use PdoMysqlQueryReflector instead
75- new MysqliQueryReflector($mysqli),
76- new SchemaHasherMysql($mysqli)
77-
69+ /*
70+ $cacheFile = __DIR__.'/.phpstan-dba.cache';
71+ $reflector = new ReplayAndRecordingQueryReflector(
72+ ReflectionCache::create(
73+ $cacheFile
7874 ),
75+ new SchemaHasherMysql($mysqli)
76+ $reflector
77+ );
78+ */
79+
80+ QueryReflection::setupReflector(
81+ $reflector,
7982 $config
8083);
8184```
0 commit comments