Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 23a0b2d

Browse files
minor #29100 [Messenger] Cleaning after new changes (yceruto)
This PR was squashed before being merged into the 4.2-dev branch (closes #29100). Discussion ---------- [Messenger] Cleaning after new changes | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - See topic per commit Commits ------- 3d31772 [Messenger] Cleaning after new changes
2 parents 5e0d3f0 + 3d31772 commit 23a0b2d

File tree

8 files changed

+9
-13
lines changed

8 files changed

+9
-13
lines changed

src/Symfony/Component/Messenger/Command/DebugCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function __construct(array $mapping)
4444
protected function configure()
4545
{
4646
$this
47-
->addArgument('bus', InputArgument::OPTIONAL, sprintf('The bus id (one of %s)', implode(', ', array_keys($this->mapping))), null)
47+
->addArgument('bus', InputArgument::OPTIONAL, sprintf('The bus id (one of %s)', implode(', ', array_keys($this->mapping))))
4848
->setDescription('Lists messages you can dispatch using the message buses')
4949
->setHelp(<<<'EOF'
5050
The <info>%command.name%</info> command displays all messages that can be

src/Symfony/Component/Messenger/DependencyInjection/MessengerPass.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
1616
use Symfony\Component\DependencyInjection\ChildDefinition;
1717
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
18-
use Symfony\Component\DependencyInjection\Compiler\PriorityTaggedServiceTrait;
1918
use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass;
2019
use Symfony\Component\DependencyInjection\ContainerBuilder;
2120
use Symfony\Component\DependencyInjection\Definition;
@@ -33,8 +32,6 @@
3332
*/
3433
class MessengerPass implements CompilerPassInterface
3534
{
36-
use PriorityTaggedServiceTrait;
37-
3835
private $handlerTag;
3936
private $busTag;
4037
private $receiverTag;
@@ -282,7 +279,7 @@ private function registerBusMiddleware(ContainerBuilder $container, string $busI
282279
throw new RuntimeException(sprintf('Invalid middleware: service "%s" not found.', $id));
283280
}
284281

285-
if (($definition = $container->findDefinition($messengerMiddlewareId))->isAbstract()) {
282+
if ($container->findDefinition($messengerMiddlewareId)->isAbstract()) {
286283
$childDefinition = new ChildDefinition($messengerMiddlewareId);
287284
$childDefinition->setArguments($arguments);
288285
$container->setDefinition($messengerMiddlewareId = $busId.'.middleware.'.$id, $childDefinition);

src/Symfony/Component/Messenger/Middleware/TraceableMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function next(): MiddlewareInterface
9090
return $nextMiddleware;
9191
}
9292

93-
public function stop()
93+
public function stop(): void
9494
{
9595
if (null !== $this->currentEvent && $this->stopwatch->isStarted($this->currentEvent)) {
9696
$this->stopwatch->stop($this->currentEvent);

src/Symfony/Component/Messenger/Tests/MessageBusTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ public function testItCallsMiddleware()
4242
{
4343
$message = new DummyMessage('Hello');
4444
$envelope = new Envelope($message);
45-
$responseFromDepthMiddleware = 1234;
4645

4746
$firstMiddleware = $this->getMockBuilder(MiddlewareInterface::class)->getMock();
4847
$firstMiddleware->expects($this->once())

src/Symfony/Component/Messenger/Tests/TraceableMessageBusTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function testItTracesDispatch()
2929

3030
$traceableBus = new TraceableMessageBus($bus);
3131
$line = __LINE__ + 1;
32-
$this->assertInstanceOf(Envelope::class, $traceableBus->dispatch($message));
32+
$traceableBus->dispatch($message);
3333
$this->assertCount(1, $tracedMessages = $traceableBus->getDispatchedMessages());
3434
$this->assertArraySubset(array(
3535
'message' => $message,
@@ -52,7 +52,7 @@ public function testItTracesDispatchWithEnvelope()
5252

5353
$traceableBus = new TraceableMessageBus($bus);
5454
$line = __LINE__ + 1;
55-
$this->assertInstanceOf(Envelope::class, $traceableBus->dispatch($envelope));
55+
$traceableBus->dispatch($envelope);
5656
$this->assertCount(1, $tracedMessages = $traceableBus->getDispatchedMessages());
5757
$this->assertArraySubset(array(
5858
'message' => $message,

src/Symfony/Component/Messenger/Tests/Transport/AmqpExt/AmqpExtIntegrationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function testItSendsAndReceivesMessages()
5656

5757
$receivedMessages = 0;
5858
$receiver->receive(function (?Envelope $envelope) use ($receiver, &$receivedMessages, $first, $second) {
59-
$this->assertEquals(0 == $receivedMessages ? $first : $second, $envelope);
59+
$this->assertEquals(0 === $receivedMessages ? $first : $second, $envelope);
6060

6161
if (2 === ++$receivedMessages) {
6262
$receiver->stop();

src/Symfony/Component/Messenger/Tests/Transport/Sender/SendersLocatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ public function testItReturnsTheSenderBasedOnTheMessageClass()
2828
));
2929

3030
$this->assertSame(array($sender), iterator_to_array($locator->getSenders(new Envelope(new DummyMessage('a')))));
31-
$this->assertSame(array(), iterator_to_array($locator->getSenders(new Envelope(new SecondMessage('b')))));
31+
$this->assertSame(array(), iterator_to_array($locator->getSenders(new Envelope(new SecondMessage()))));
3232
}
3333
}

src/Symfony/Component/Messenger/Transport/Serialization/Serializer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function encode(Envelope $envelope): array
9999
);
100100
}
101101

102-
private function decodeStamps($encodedEnvelope)
102+
private function decodeStamps(array $encodedEnvelope): array
103103
{
104104
$stamps = array();
105105
foreach ($encodedEnvelope['headers'] as $name => $value) {
@@ -113,7 +113,7 @@ private function decodeStamps($encodedEnvelope)
113113
return $stamps;
114114
}
115115

116-
private function encodeStamps(Envelope $envelope)
116+
private function encodeStamps(Envelope $envelope): array
117117
{
118118
if (!$stamps = $envelope->all()) {
119119
return array();

0 commit comments

Comments
 (0)