Skip to content

Commit 4e83544

Browse files
committed
Merge remote-tracking branch 'origin/2.11.x' into 2.12.x
2 parents c081482 + 7150c1d commit 4e83544

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

.github/workflows/static-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ jobs:
3131
uses: "ramsey/composer-install@v2"
3232

3333
- name: "Run a static analysis with vimeo/psalm"
34-
run: "vendor/bin/psalm --show-info=false --stats --output-format=github --threads=$(nproc) --find-unused-psalm-suppress"
34+
run: "vendor/bin/psalm --show-info=false --stats --output-format=github --find-unused-psalm-suppress"

Command/CreateDatabaseDoctrineCommand.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Doctrine\Bundle\DoctrineBundle\Command;
44

55
use Doctrine\DBAL\DriverManager;
6+
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
67
use InvalidArgumentException;
78
use Symfony\Component\Console\Input\InputInterface;
89
use Symfony\Component\Console\Input\InputOption;
@@ -60,10 +61,14 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6061
throw new InvalidArgumentException("Connection does not contain a 'path' or 'dbname' parameter and cannot be created.");
6162
}
6263

63-
// Need to get rid of _every_ occurrence of dbname from connection configuration and we have already extracted all relevant info from url
64+
// Need to get rid of _every_ occurrence of dbname from connection configuration as we have already extracted all relevant info from url
6465
/** @psalm-suppress InvalidArrayOffset Need to be compatible with DBAL < 4, which still has `$params['url']` */
6566
unset($params['dbname'], $params['path'], $params['url']);
6667

68+
if ($connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
69+
$params['dbname'] = 'postgres';
70+
}
71+
6772
$tmpConnection = DriverManager::getConnection($params, $connection->getConfiguration());
6873
$schemaManager = $tmpConnection->createSchemaManager();
6974
$shouldNotCreateDatabase = $ifNotExists && in_array($name, $schemaManager->listDatabases());

Command/DropDatabaseDoctrineCommand.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Doctrine\Bundle\DoctrineBundle\Command;
44

55
use Doctrine\DBAL\DriverManager;
6+
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
67
use Doctrine\DBAL\Schema\SQLiteSchemaManager;
78
use InvalidArgumentException;
89
use Symfony\Component\Console\Input\InputInterface;
@@ -75,6 +76,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7576
/** @psalm-suppress InvalidArrayOffset Need to be compatible with DBAL < 4, which still has `$params['url']` */
7677
unset($params['dbname'], $params['url']);
7778

79+
if ($connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
80+
$params['dbname'] = 'postgres';
81+
}
82+
7883
if (! $input->getOption('force')) {
7984
$output->writeln('<error>ATTENTION:</error> This operation should not be executed in a production environment.');
8085
$output->writeln('');

DependencyInjection/DoctrineExtension.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,6 @@ private function loadMessengerServices(ContainerBuilder $container): void
11361136
{
11371137
// If the Messenger component is installed, wire it:
11381138

1139-
/** @psalm-suppress UndefinedClass Optional dependency */
11401139
if (! interface_exists(MessageBusInterface::class)) {
11411140
return;
11421141
}

Tests/DependencyInjection/DoctrineExtensionTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,6 @@ public function testAnnotationsBundleMappingDetectionWithVendorNamespace(): void
988988

989989
public function testMessengerIntegration(): void
990990
{
991-
/** @psalm-suppress UndefinedClass */
992991
if (! interface_exists(MessageBusInterface::class)) {
993992
$this->markTestSkipped('Symfony Messenger component is not installed');
994993
}
@@ -1014,7 +1013,6 @@ public function testMessengerIntegration(): void
10141013

10151014
public function testMessengerIntegrationWithDoctrineTransport(): void
10161015
{
1017-
/** @psalm-suppress UndefinedClass */
10181016
if (! interface_exists(MessageBusInterface::class)) {
10191017
$this->markTestSkipped('Symfony Messenger component is not installed');
10201018
}
@@ -1046,7 +1044,6 @@ public function testMessengerIntegrationWithDoctrineTransport(): void
10461044

10471045
public function testMessengerIntegrationWithoutDoctrineTransport(): void
10481046
{
1049-
/** @psalm-suppress UndefinedClass */
10501047
if (! interface_exists(MessageBusInterface::class)) {
10511048
$this->markTestSkipped('Symfony Messenger component is not installed');
10521049
}

0 commit comments

Comments
 (0)