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 64e5c13 commit cebf7ba
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/ReflectorFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,13 @@ public static function create(string $cacheDir): QueryReflector
$options[PDO::MYSQL_ATTR_SSL_CA] = $ssl;
$options[PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT] = false;
}
$pdo = new PDO(sprintf('mysql:dbname=%s;host=%s;port=%s', $dbname, $host, $port), $user, $password, $options);
$port = $port != null ? ';port='.$port : '';
$pdo = new PDO(sprintf('mysql:dbname=%s;host=%s', $dbname, $host). $port, $user, $password, $options);
$reflector = new PdoMysqlQueryReflector($pdo);
$schemaHasher = new SchemaHasherMysql($pdo);
} elseif ('pdo-pgsql' === $reflector) {
$pdo = new PDO(sprintf('pgsql:dbname=%s;host=%s;port=%s', $dbname, $host, $port), $user, $password);
$port = $port != null ? ';port='.$port : '';
$pdo = new PDO(sprintf('pgsql:dbname=%s;host=%s', $dbname, $host). $port, $user, $password);
$reflector = new PdoPgSqlQueryReflector($pdo);
} else {
throw new \RuntimeException('Unknown reflector: ' . $reflector);
Expand Down

0 comments on commit cebf7ba

Please sign in to comment.