From 0a5e5f3cc1c95bc5ba4351cbabb508350c842b7b Mon Sep 17 00:00:00 2001 From: Damien Harper Date: Tue, 19 Dec 2023 11:37:38 +0100 Subject: [PATCH] PHP-CS-Fixer --- .../Auditing/Event/DoctrineSubscriber.php | 2 +- .../Doctrine/Event/DoctrineSubscriberTest.php | 30 +++++++++++-------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/Provider/Doctrine/Auditing/Event/DoctrineSubscriber.php b/src/Provider/Doctrine/Auditing/Event/DoctrineSubscriber.php index d57b89d0..f43cc7a2 100644 --- a/src/Provider/Doctrine/Auditing/Event/DoctrineSubscriber.php +++ b/src/Provider/Doctrine/Auditing/Event/DoctrineSubscriber.php @@ -74,7 +74,7 @@ public function onFlush(OnFlushEventArgs $args): void // Initialize a new LoggerChain with the new AuditLogger + the existing SQLLoggers. $loggerChain = new LoggerChain(); - if ($currentLogger !== null) { + if (null !== $currentLogger) { $loggerChain->addLogger($currentLogger); } $loggerChain->addLogger($auditLogger); diff --git a/tests/Provider/Doctrine/Event/DoctrineSubscriberTest.php b/tests/Provider/Doctrine/Event/DoctrineSubscriberTest.php index e31dd4c1..f036c365 100644 --- a/tests/Provider/Doctrine/Event/DoctrineSubscriberTest.php +++ b/tests/Provider/Doctrine/Event/DoctrineSubscriberTest.php @@ -1,5 +1,7 @@ method('getConnection') - ->willReturn($connection = $this->createMock(Connection::class)); + ->willReturn($connection = $this->createMock(Connection::class)) + ; $connection ->method('getDriver') - ->willReturn($driver = $this->createMock(Driver::class)); + ->willReturn($driver = $this->createMock(Driver::class)) + ; $connection ->method('getConfiguration') - ->willReturn($configuration = new Configuration()); + ->willReturn($configuration = new Configuration()) + ; - $configuration->setSQLLogger(new class implements SQLLogger { - public function startQuery($sql, ?array $params = null, ?array $types = null) - { - } + $configuration->setSQLLogger(new class() implements SQLLogger { + public function startQuery($sql, ?array $params = null, ?array $types = null): void {} - public function stopQuery() - { - } + public function stopQuery(): void {} }); $target = new DoctrineSubscriber($transactionManager); @@ -53,4 +59,4 @@ public function stopQuery() $result = $configuration->getSQLLogger(); self::assertCount(2, $result->getLoggers()); } -} \ No newline at end of file +}