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

Skip to content

Commit dd1edf3

Browse files
committed
renaming purge command to remove
1 parent 5b22973 commit dd1edf3

File tree

7 files changed

+14
-15
lines changed

7 files changed

+14
-15
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ public function load(array $configs, ContainerBuilder $container)
286286
$container->removeDefinition('console.command.messenger_setup_transports');
287287
$container->removeDefinition('console.command.messenger_failed_messages_retry');
288288
$container->removeDefinition('console.command.messenger_failed_messages_show');
289-
$container->removeDefinition('console.command.messenger_failed_messages_purge');
289+
$container->removeDefinition('console.command.messenger_failed_messages_remove');
290290
}
291291

292292
$propertyInfoEnabled = $this->isConfigEnabled($container, $config['property_info']);
@@ -1781,12 +1781,12 @@ private function registerMessengerConfiguration(array $config, ContainerBuilder
17811781
->replaceArgument(4, $transportRetryReferences[$config['failure_transport']] ?? null);
17821782
$container->getDefinition('console.command.messenger_failed_messages_show')
17831783
->replaceArgument(0, $config['failure_transport']);
1784-
$container->getDefinition('console.command.messenger_failed_messages_purge')
1784+
$container->getDefinition('console.command.messenger_failed_messages_remove')
17851785
->replaceArgument(0, $config['failure_transport']);
17861786
} else {
17871787
$container->removeDefinition('console.command.messenger_failed_messages_retry');
17881788
$container->removeDefinition('console.command.messenger_failed_messages_show');
1789-
$container->removeDefinition('console.command.messenger_failed_messages_purge');
1789+
$container->removeDefinition('console.command.messenger_failed_messages_remove');
17901790
}
17911791
}
17921792

src/Symfony/Bundle/FrameworkBundle/Resources/config/console.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,11 @@
132132
<tag name="console.command" command="messenger:failed:show" />
133133
</service>
134134

135-
<service id="console.command.messenger_failed_messages_purge" class="Symfony\Component\Messenger\Command\FailedMessagesPurgeCommand">
135+
<service id="console.command.messenger_failed_messages_remove" class="Symfony\Component\Messenger\Command\FailedMessagesRemoveCommand">
136136
<argument /> <!-- Receiver name -->
137137
<argument /> <!-- Receiver locator -->
138138

139-
<tag name="console.command" command="messenger:failed:purge" />
139+
<tag name="console.command" command="messenger:failed:remove" />
140140
</service>
141141

142142
<service id="console.command.router_debug" class="Symfony\Bundle\FrameworkBundle\Command\RouterDebugCommand">

src/Symfony/Component/Messenger/Command/FailedMessagesPurgeCommand.php renamed to src/Symfony/Component/Messenger/Command/FailedMessagesRemoveCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
*
2727
* @experimental in 4.3
2828
*/
29-
class FailedMessagesPurgeCommand extends AbstractFailedMessagesCommand
29+
class FailedMessagesRemoveCommand extends AbstractFailedMessagesCommand
3030
{
31-
protected static $defaultName = 'messenger:failed:purge';
31+
protected static $defaultName = 'messenger:failed:remove';
3232

3333
/**
3434
* {@inheritdoc}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ private function runInteractive(SymfonyStyle $io, bool $shouldForce)
132132
while (true) {
133133
$ids = [];
134134
foreach ($receiver->all(1) as $envelope) {
135-
$count++;
135+
++$count;
136136

137137
$id = $this->getMessageId($envelope);
138138
if (null === $id) {
@@ -188,7 +188,7 @@ private function runWorker(ReceiverInterface $receiver, SymfonyStyle $io, bool $
188188
$count = 0;
189189
try {
190190
$worker->run([], function (?Envelope $envelope) use ($worker, $io, &$count) {
191-
$count++;
191+
++$count;
192192
if (null === $envelope) {
193193
$worker->stop();
194194
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
use Symfony\Component\Console\Style\SymfonyStyle;
2121
use Symfony\Component\Messenger\Stamp\SentToFailureTransportStamp;
2222
use Symfony\Component\Messenger\Transport\Receiver\ListableReceiverInterface;
23-
use Symfony\Component\Messenger\Transport\Receiver\MessageCountAwareInterface;
2423

2524
/**
2625
* @author Ryan Weaver <[email protected]>
@@ -124,7 +123,7 @@ private function showMessage($id, SymfonyStyle $io)
124123
$io->writeln([
125124
'',
126125
sprintf(' Run <comment>messenger:failed:retry %s</comment> to retry this message.', $id),
127-
sprintf(' Run <comment>messenger:failed:purge %s</comment> to delete it.', $id),
126+
sprintf(' Run <comment>messenger:failed:remove %s</comment> to delete it.', $id),
128127
]);
129128
}
130129
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ private function registerReceivers(ContainerBuilder $container, array $busIds)
274274
$failedCommandIds = [
275275
'console.command.messenger_failed_messages_retry',
276276
'console.command.messenger_failed_messages_show',
277-
'console.command.messenger_failed_messages_purge',
277+
'console.command.messenger_failed_messages_remove',
278278
];
279279
foreach ($failedCommandIds as $failedCommandId) {
280280
if ($container->hasDefinition($failedCommandId)) {

src/Symfony/Component/Messenger/Tests/Command/FailedMessagesPurgeCommandTest.php renamed to src/Symfony/Component/Messenger/Tests/Command/FailedMessagesRemoveCommandTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@
1313

1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Component\Console\Tester\CommandTester;
16-
use Symfony\Component\Messenger\Command\FailedMessagesPurgeCommand;
16+
use Symfony\Component\Messenger\Command\FailedMessagesRemoveCommand;
1717
use Symfony\Component\Messenger\Envelope;
1818
use Symfony\Component\Messenger\Transport\Receiver\ListableReceiverInterface;
1919

20-
class FailedMessagesPurgeCommandTest extends TestCase
20+
class FailedMessagesRemoveCommandTest extends TestCase
2121
{
2222
public function testBasicRun()
2323
{
2424
$receiver = $this->createMock(ListableReceiverInterface::class);
2525
$receiver->expects($this->once())->method('find')->with(20)->willReturn(new Envelope(new \stdClass()));
2626

27-
$command = new FailedMessagesPurgeCommand(
27+
$command = new FailedMessagesRemoveCommand(
2828
'failure_receiver',
2929
$receiver
3030
);

0 commit comments

Comments
 (0)