Skip to content

Commit

Permalink
Update ReflectorFactory.php
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Nov 27, 2024
1 parent d2ade4c commit c9caf70
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/ReflectorFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public static function create(string $cacheDir): QueryReflector
$ssl = false;
$mode = getenv('DBA_MODE') ?: self::MODE_RECORDING;
$reflector = getenv('DBA_REFLECTOR') ?: 'mysqli';
$platform = $_ENV['DBA_PLATFORM'] ?: 'mysql';
} else {
$host = getenv('DBA_HOST') ?: $_ENV['DBA_HOST'];
$user = getenv('DBA_USER') ?: $_ENV['DBA_USER'];
Expand All @@ -42,10 +43,12 @@ public static function create(string $cacheDir): QueryReflector
$ssl = (string) (getenv('DBA_SSL') ?: $_ENV['DBA_SSL'] ?? '');
$mode = getenv('DBA_MODE') ?: $_ENV['DBA_MODE'];
$reflector = getenv('DBA_REFLECTOR') ?: $_ENV['DBA_REFLECTOR'];
$platform = $_ENV['DBA_PLATFORM'] ?: $_ENV['DBA_PLATFORM'];
}

// make env vars available to tests, in case non are defined yet
$_ENV['DBA_REFLECTOR'] = $reflector;
$_ENV['DBA_PLATFORM'] = $platform;

// we need to record the reflection information in both, phpunit and phpstan since we are replaying it in both CI jobs.
// in a regular application you will use phpstan-dba only within your phpstan CI job, therefore you only need 1 cache-file.
Expand Down

0 comments on commit c9caf70

Please sign in to comment.