Skip to content

Commit 627660b

Browse files
[Messenger] cs fix
1 parent 63221f0 commit 627660b

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ protected function interact(InputInterface $input, OutputInterface $output)
119119
{
120120
$io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output);
121121

122-
if ($this->receiverNames && 0 === \count($input->getArgument('receivers'))) {
122+
if ($this->receiverNames && !$input->getArgument('receivers')) {
123123
$io->block('Which transports/receivers do you want to consume?', null, 'fg=white;bg=blue', ' ', true);
124124

125125
$io->writeln('Choose which receivers you want to consume messages from in order of priority.');
@@ -133,7 +133,7 @@ protected function interact(InputInterface $input, OutputInterface $output)
133133
$input->setArgument('receivers', $io->askQuestion($question));
134134
}
135135

136-
if (0 === \count($input->getArgument('receivers'))) {
136+
if (!$input->getArgument('receivers')) {
137137
throw new RuntimeException('Please pass at least one receiver.');
138138
}
139139
}
@@ -164,7 +164,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
164164
}
165165

166166
$stopsWhen = [];
167-
if (null !== ($limit = $input->getOption('limit'))) {
167+
if (null !== $limit = $input->getOption('limit')) {
168168
if (!is_numeric($limit) || 0 >= $limit) {
169169
throw new InvalidOptionException(sprintf('Option "limit" must be a positive integer, "%s" passed.', $limit));
170170
}
@@ -178,7 +178,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
178178
$this->eventDispatcher->addSubscriber(new StopWorkerOnMemoryLimitListener($this->convertToBytes($memoryLimit), $this->logger));
179179
}
180180

181-
if (null !== ($timeLimit = $input->getOption('time-limit'))) {
181+
if (null !== $timeLimit = $input->getOption('time-limit')) {
182182
if (!is_numeric($timeLimit) || 0 >= $timeLimit) {
183183
throw new InvalidOptionException(sprintf('Option "time-limit" must be a positive integer, "%s" passed.', $timeLimit));
184184
}
@@ -190,7 +190,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
190190
$stopsWhen[] = 'received a stop signal via the messenger:stop-workers command';
191191

192192
$io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output);
193-
$io->success(sprintf('Consuming messages from transport%s "%s".', \count($receivers) > 0 ? 's' : '', implode(', ', $receiverNames)));
193+
$io->success(sprintf('Consuming messages from transport%s "%s".', \count($receivers) > 1 ? 's' : '', implode(', ', $receiverNames)));
194194

195195
if ($stopsWhen) {
196196
$last = array_pop($stopsWhen);

src/Symfony/Component/Messenger/Tests/Command/ConsumeMessagesCommandTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function testBasicRun()
6565
]);
6666

6767
$this->assertSame(0, $tester->getStatusCode());
68-
$this->assertStringContainsString('[OK] Consuming messages from transports "dummy-receiver"', $tester->getDisplay());
68+
$this->assertStringContainsString('[OK] Consuming messages from transport "dummy-receiver"', $tester->getDisplay());
6969
}
7070

7171
public function testRunWithBusOption()
@@ -98,7 +98,7 @@ public function testRunWithBusOption()
9898
]);
9999

100100
$this->assertSame(0, $tester->getStatusCode());
101-
$this->assertStringContainsString('[OK] Consuming messages from transports "dummy-receiver"', $tester->getDisplay());
101+
$this->assertStringContainsString('[OK] Consuming messages from transport "dummy-receiver"', $tester->getDisplay());
102102
}
103103

104104
/**
@@ -134,7 +134,7 @@ public function testBasicRunWithBusLocator()
134134
]);
135135

136136
$this->assertSame(0, $tester->getStatusCode());
137-
$this->assertStringContainsString('[OK] Consuming messages from transports "dummy-receiver"', $tester->getDisplay());
137+
$this->assertStringContainsString('[OK] Consuming messages from transport "dummy-receiver"', $tester->getDisplay());
138138
}
139139

140140
/**
@@ -171,7 +171,7 @@ public function testRunWithBusOptionAndBusLocator()
171171
]);
172172

173173
$this->assertSame(0, $tester->getStatusCode());
174-
$this->assertStringContainsString('[OK] Consuming messages from transports "dummy-receiver"', $tester->getDisplay());
174+
$this->assertStringContainsString('[OK] Consuming messages from transport "dummy-receiver"', $tester->getDisplay());
175175
}
176176

177177
/**
@@ -235,6 +235,6 @@ public function testRunWithTimeLimit()
235235
]);
236236

237237
$this->assertSame(0, $tester->getStatusCode());
238-
$this->assertStringContainsString('[OK] Consuming messages from transports "dummy-receiver"', $tester->getDisplay());
238+
$this->assertStringContainsString('[OK] Consuming messages from transport "dummy-receiver"', $tester->getDisplay());
239239
}
240240
}

0 commit comments

Comments
 (0)