diff --git a/src/Symfony/Component/Messenger/Command/DebugCommand.php b/src/Symfony/Component/Messenger/Command/DebugCommand.php index 631bace66ab98..4abfa03e17687 100644 --- a/src/Symfony/Component/Messenger/Command/DebugCommand.php +++ b/src/Symfony/Component/Messenger/Command/DebugCommand.php @@ -44,7 +44,7 @@ public function __construct(array $mapping) protected function configure() { $this - ->addArgument('bus', InputArgument::OPTIONAL, sprintf('The bus id (one of %s)', implode(', ', array_keys($this->mapping))), null) + ->addArgument('bus', InputArgument::OPTIONAL, sprintf('The bus id (one of %s)', implode(', ', array_keys($this->mapping)))) ->setDescription('Lists messages you can dispatch using the message buses') ->setHelp(<<<'EOF' The %command.name% command displays all messages that can be diff --git a/src/Symfony/Component/Messenger/DependencyInjection/MessengerPass.php b/src/Symfony/Component/Messenger/DependencyInjection/MessengerPass.php index a22a085bd0f50..11d64c1a3f467 100644 --- a/src/Symfony/Component/Messenger/DependencyInjection/MessengerPass.php +++ b/src/Symfony/Component/Messenger/DependencyInjection/MessengerPass.php @@ -15,7 +15,6 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator; use Symfony\Component\DependencyInjection\ChildDefinition; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\Compiler\PriorityTaggedServiceTrait; use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; @@ -33,8 +32,6 @@ */ class MessengerPass implements CompilerPassInterface { - use PriorityTaggedServiceTrait; - private $handlerTag; private $busTag; private $receiverTag; @@ -282,7 +279,7 @@ private function registerBusMiddleware(ContainerBuilder $container, string $busI throw new RuntimeException(sprintf('Invalid middleware: service "%s" not found.', $id)); } - if (($definition = $container->findDefinition($messengerMiddlewareId))->isAbstract()) { + if ($container->findDefinition($messengerMiddlewareId)->isAbstract()) { $childDefinition = new ChildDefinition($messengerMiddlewareId); $childDefinition->setArguments($arguments); $container->setDefinition($messengerMiddlewareId = $busId.'.middleware.'.$id, $childDefinition); diff --git a/src/Symfony/Component/Messenger/Middleware/TraceableMiddleware.php b/src/Symfony/Component/Messenger/Middleware/TraceableMiddleware.php index e9a2be37eeeac..771c14633eb83 100644 --- a/src/Symfony/Component/Messenger/Middleware/TraceableMiddleware.php +++ b/src/Symfony/Component/Messenger/Middleware/TraceableMiddleware.php @@ -90,7 +90,7 @@ public function next(): MiddlewareInterface return $nextMiddleware; } - public function stop() + public function stop(): void { if (null !== $this->currentEvent && $this->stopwatch->isStarted($this->currentEvent)) { $this->stopwatch->stop($this->currentEvent); diff --git a/src/Symfony/Component/Messenger/Tests/MessageBusTest.php b/src/Symfony/Component/Messenger/Tests/MessageBusTest.php index 6d8311e4759a0..3dedb59c63db5 100644 --- a/src/Symfony/Component/Messenger/Tests/MessageBusTest.php +++ b/src/Symfony/Component/Messenger/Tests/MessageBusTest.php @@ -42,7 +42,6 @@ public function testItCallsMiddleware() { $message = new DummyMessage('Hello'); $envelope = new Envelope($message); - $responseFromDepthMiddleware = 1234; $firstMiddleware = $this->getMockBuilder(MiddlewareInterface::class)->getMock(); $firstMiddleware->expects($this->once()) diff --git a/src/Symfony/Component/Messenger/Tests/TraceableMessageBusTest.php b/src/Symfony/Component/Messenger/Tests/TraceableMessageBusTest.php index a2c4e0b8c6bf4..371915d9539f3 100644 --- a/src/Symfony/Component/Messenger/Tests/TraceableMessageBusTest.php +++ b/src/Symfony/Component/Messenger/Tests/TraceableMessageBusTest.php @@ -29,7 +29,7 @@ public function testItTracesDispatch() $traceableBus = new TraceableMessageBus($bus); $line = __LINE__ + 1; - $this->assertInstanceOf(Envelope::class, $traceableBus->dispatch($message)); + $traceableBus->dispatch($message); $this->assertCount(1, $tracedMessages = $traceableBus->getDispatchedMessages()); $this->assertArraySubset(array( 'message' => $message, @@ -52,7 +52,7 @@ public function testItTracesDispatchWithEnvelope() $traceableBus = new TraceableMessageBus($bus); $line = __LINE__ + 1; - $this->assertInstanceOf(Envelope::class, $traceableBus->dispatch($envelope)); + $traceableBus->dispatch($envelope); $this->assertCount(1, $tracedMessages = $traceableBus->getDispatchedMessages()); $this->assertArraySubset(array( 'message' => $message, diff --git a/src/Symfony/Component/Messenger/Tests/Transport/AmqpExt/AmqpExtIntegrationTest.php b/src/Symfony/Component/Messenger/Tests/Transport/AmqpExt/AmqpExtIntegrationTest.php index f0476524a011b..511965cc01899 100644 --- a/src/Symfony/Component/Messenger/Tests/Transport/AmqpExt/AmqpExtIntegrationTest.php +++ b/src/Symfony/Component/Messenger/Tests/Transport/AmqpExt/AmqpExtIntegrationTest.php @@ -56,7 +56,7 @@ public function testItSendsAndReceivesMessages() $receivedMessages = 0; $receiver->receive(function (?Envelope $envelope) use ($receiver, &$receivedMessages, $first, $second) { - $this->assertEquals(0 == $receivedMessages ? $first : $second, $envelope); + $this->assertEquals(0 === $receivedMessages ? $first : $second, $envelope); if (2 === ++$receivedMessages) { $receiver->stop(); diff --git a/src/Symfony/Component/Messenger/Tests/Transport/Sender/SendersLocatorTest.php b/src/Symfony/Component/Messenger/Tests/Transport/Sender/SendersLocatorTest.php index b703f4481ef5a..f756121e094b4 100644 --- a/src/Symfony/Component/Messenger/Tests/Transport/Sender/SendersLocatorTest.php +++ b/src/Symfony/Component/Messenger/Tests/Transport/Sender/SendersLocatorTest.php @@ -28,6 +28,6 @@ public function testItReturnsTheSenderBasedOnTheMessageClass() )); $this->assertSame(array($sender), iterator_to_array($locator->getSenders(new Envelope(new DummyMessage('a'))))); - $this->assertSame(array(), iterator_to_array($locator->getSenders(new Envelope(new SecondMessage('b'))))); + $this->assertSame(array(), iterator_to_array($locator->getSenders(new Envelope(new SecondMessage())))); } } diff --git a/src/Symfony/Component/Messenger/Transport/Serialization/Serializer.php b/src/Symfony/Component/Messenger/Transport/Serialization/Serializer.php index dbfc352c24553..430a5fca0606c 100644 --- a/src/Symfony/Component/Messenger/Transport/Serialization/Serializer.php +++ b/src/Symfony/Component/Messenger/Transport/Serialization/Serializer.php @@ -99,7 +99,7 @@ public function encode(Envelope $envelope): array ); } - private function decodeStamps($encodedEnvelope) + private function decodeStamps(array $encodedEnvelope): array { $stamps = array(); foreach ($encodedEnvelope['headers'] as $name => $value) { @@ -113,7 +113,7 @@ private function decodeStamps($encodedEnvelope) return $stamps; } - private function encodeStamps(Envelope $envelope) + private function encodeStamps(Envelope $envelope): array { if (!$stamps = $envelope->all()) { return array();