From 7ab2080d4a1e5ca2eaf4840a813d635f3578c8b8 Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 18 Dec 2023 13:42:54 +0200 Subject: [PATCH] Fix build (#128) * Fix a deprecation * Fix using the prophecy * Update PHPUnit to avoid deprecations --- QueueInteropTransport.php | 2 +- Tests/QueueInteropTransportFactoryTest.php | 2 +- composer.json | 3 ++- phpunit.xml.dist | 6 +++--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/QueueInteropTransport.php b/QueueInteropTransport.php index ed8f9f9..0ae2921 100644 --- a/QueueInteropTransport.php +++ b/QueueInteropTransport.php @@ -172,7 +172,7 @@ public function send(Envelope $envelope): Envelope $producer->send($topic, $interopMessage); } catch (InteropQueueException $e) { if (!$this->contextManager->recoverException($e, $destination)) { - throw new SendingMessageFailedException($e->getMessage(), null, $e); + throw new SendingMessageFailedException(message: $e->getMessage(), previous: $e); } // The context manager recovered the exception, we re-try. diff --git a/Tests/QueueInteropTransportFactoryTest.php b/Tests/QueueInteropTransportFactoryTest.php index 1e252c0..2e1cb97 100644 --- a/Tests/QueueInteropTransportFactoryTest.php +++ b/Tests/QueueInteropTransportFactoryTest.php @@ -94,7 +94,7 @@ public function testItThrowsAnExceptionWhenContextDoesNotExist() $container = $this->prophesize(ContainerInterface::class); $container->has('enqueue.transport.foo.context')->willReturn(false); - $factory = $this->getFactory(); + $factory = $this->getFactory(container: $container->reveal()); $factory->createTransport('enqueue://foo', array()); } diff --git a/composer.json b/composer.json index ef140c8..d4e26a8 100644 --- a/composer.json +++ b/composer.json @@ -16,6 +16,7 @@ } ], "require": { + "php": "^8.1", "enqueue/enqueue-bundle": "^0.10", "symfony/messenger": "^5.4 || ^6.3 || ^7.0", "symfony/options-resolver": "^5.4 || ^6.3 || ^7.0", @@ -37,7 +38,7 @@ } }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^10.0", "symfony/yaml": "^5.4 || ^6.3 || ^7.0", "enqueue/snsqs": "^0.10.11", "phpspec/prophecy-phpunit": "^2.0", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 203d8dc..0b9b19f 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,7 +1,7 @@ - + ./ @@ -26,5 +26,5 @@ ./Tests ./vendor - +