Skip to content

Commit f48fc62

Browse files
staabmclxmstaab
andauthored
Simplify Readme (#746)
Co-authored-by: Markus Staab <[email protected]>
1 parent 327176e commit f48fc62

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

README.md

+14-11
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ use staabm\PHPStanDba\QueryReflection\ReflectionCache;
5555

5656
require_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

Comments
 (0)