Skip to content

Commit

Permalink
fix: PHPStan fixes for new rules in latest update
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamVyborny committed Sep 2, 2024
1 parent d5e056b commit e5c5da5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tests/functional/DatadirTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,15 @@ protected function setUp(): void
/** @var array<array> $config */
$config = json_decode((string) $configContent, true);
preg_match('/%env\(string:([A-Z_]+)\)%/', $config['parameters']['db']['host'], $hostEnv);
$host = isset($hostEnv[1]) ? getenv($hostEnv[1]) : null;

if ($host) {
$this->connection = PdoTestConnection::createConnection(
(string) $host,
);
$this->removeAllTables();
}

$this->connection = PdoTestConnection::createConnection(
(string) getenv($hostEnv[1]),
);
$this->removeAllTables();
$this->closeSshTunnels();

// Load setUp.php file - used to init database state
Expand Down

0 comments on commit e5c5da5

Please sign in to comment.