Skip to content

Commit

Permalink
Merge branch '5.4' into 6.2
Browse files Browse the repository at this point in the history
* 5.4:
  [DoctrineBridge] Work around "Doctrine\DBAL\Connection::getEventManager()" deprecations
  [Routing] Fix Psalm
  [Lock] Fix sprintf
  Fix Crawler::filter throw phpdoc
  • Loading branch information
nicolas-grekas committed Jun 5, 2023
2 parents 2c9d6ca + 0d2da63 commit 3a5ed31
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Tests/DoctrineTestHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Symfony\Bridge\Doctrine\Tests;

use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Common\EventManager;
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Schema\DefaultSchemaManagerFactory;
use Doctrine\ORM\Configuration;
Expand Down Expand Up @@ -51,7 +52,9 @@ public static function createTestEntityManager(Configuration $config = null): En
return EntityManager::create($params, $config);
}

return new EntityManager(DriverManager::getConnection($params, $config), $config);
$eventManager = new EventManager();

return new EntityManager(DriverManager::getConnection($params, $config, $eventManager), $config, $eventManager);
}

public static function createTestConfiguration(): Configuration
Expand Down
4 changes: 3 additions & 1 deletion Tests/PropertyInfo/DoctrineExtractorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\EventManager;
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Schema\DefaultSchemaManagerFactory;
use Doctrine\DBAL\Types\Type as DBALType;
Expand Down Expand Up @@ -54,7 +55,8 @@ private function createExtractor()
if (!(new \ReflectionMethod(EntityManager::class, '__construct'))->isPublic()) {
$entityManager = EntityManager::create(['driver' => 'pdo_sqlite'], $config);
} else {
$entityManager = new EntityManager(DriverManager::getConnection(['driver' => 'pdo_sqlite'], $config), $config);
$eventManager = new EventManager();
$entityManager = new EntityManager(DriverManager::getConnection(['driver' => 'pdo_sqlite'], $config, $eventManager), $config, $eventManager);
}

if (!DBALType::hasType('foo')) {
Expand Down

0 comments on commit 3a5ed31

Please sign in to comment.