@@ -55,8 +55,6 @@ use staabm\PHPStanDba\QueryReflection\ReflectionCache;
55
55
56
56
require_once __DIR__ . '/vendor/autoload.php';
57
57
58
- $cacheFile = __DIR__.'/.phpstan-dba.cache';
59
-
60
58
$config = new RuntimeConfiguration();
61
59
// $config->debugMode(true);
62
60
// $config->stringifyTypes(true);
@@ -65,17 +63,22 @@ $config = new RuntimeConfiguration();
65
63
66
64
// TODO: Put your database credentials here
67
65
$mysqli = new mysqli('hostname', 'username', 'password', 'database');
66
+ // Alternatively you can use PdoMysqlQueryReflector, PdoPgSqlQueryReflector instead
67
+ $reflector = new MysqliQueryReflector($mysqli);
68
68
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
78
74
),
75
+ new SchemaHasherMysql($mysqli)
76
+ $reflector
77
+ );
78
+ */
79
+
80
+ QueryReflection::setupReflector(
81
+ $reflector,
79
82
$config
80
83
);
81
84
```
0 commit comments