Skip to content

Commit

Permalink
Fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed May 29, 2024
1 parent 93f8eef commit ef0eb9b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
17 changes: 9 additions & 8 deletions src/Doctrine/RegisterListenersService.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,20 @@ public function register(ObjectManager $manager, PagerInterface $pager, array $o

if (
false === $options['debug_logging']
&& interface_exists('Doctrine\DBAL\Logging\SQLLogger')
&& $manager instanceof EntityManagerInterface
) {
$configuration = $manager->getConnection()->getConfiguration();
$logger = $configuration->getSQLLogger();
if (\method_exists($configuration, 'getSQLLogger') && \method_exists($configuration, 'setSQLLogger')) {
$logger = $configuration->getSQLLogger();

$this->addListener($pager, PreFetchObjectsEvent::class, function () use ($configuration) {
$configuration->setSQLLogger(null);
});
$this->addListener($pager, PreFetchObjectsEvent::class, function () use ($configuration) {
$configuration->setSQLLogger(null);
});

$this->addListener($pager, PreInsertObjectsEvent::class, function () use ($configuration, $logger) {
$configuration->setSQLLogger($logger);
});
$this->addListener($pager, PreInsertObjectsEvent::class, function () use ($configuration, $logger) {
$configuration->setSQLLogger($logger);
});
}
}
}

Expand Down
1 change: 0 additions & 1 deletion tests/Unit/Doctrine/ORM/ElasticaToModelTransformerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace FOS\ElasticaBundle\Tests\Unit\Doctrine\ORM;

use Doctrine\ORM\AbstractQuery;
use Doctrine\ORM\Query;
use Doctrine\ORM\Query\Expr;
use Doctrine\ORM\QueryBuilder;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Doctrine/RegisterListenersServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public function testShouldNotCallSleepListenerForAnotherPagers()

public function testShouldRegisterDisableDebugLoggingByDefaultForEntityManager()
{
if (!interface_exists('Doctrine\DBAL\Logging\SQLLogger')) {
if (!\interface_exists('Doctrine\DBAL\Logging\SQLLogger')) {
$this->markTestSkipped('This is only possible on doctrine/orm 2.');
}

Expand Down

0 comments on commit ef0eb9b

Please sign in to comment.