Skip to content

Commit c591b4d

Browse files
Merge branch '7.1' into 7.2
* 7.1: fix: notifier push channel bus abstract arg [Scheduler] remove dead code
2 parents dcf824a + 70578e5 commit c591b4d

File tree

4 files changed

+28
-58
lines changed

4 files changed

+28
-58
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2784,7 +2784,7 @@ private function registerNotifierConfiguration(array $config, ContainerBuilder $
27842784
$container->removeDefinition('notifier.channel.email');
27852785
}
27862786

2787-
foreach (['texter', 'chatter', 'notifier.channel.chat', 'notifier.channel.email', 'notifier.channel.sms'] as $serviceId) {
2787+
foreach (['texter', 'chatter', 'notifier.channel.chat', 'notifier.channel.email', 'notifier.channel.sms', 'notifier.channel.push'] as $serviceId) {
27882788
if (!$container->hasDefinition($serviceId)) {
27892789
continue;
27902790
}

src/Symfony/Bundle/FrameworkBundle/Resources/config/notifier.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@
7575
->tag('notifier.channel', ['channel' => 'email'])
7676

7777
->set('notifier.channel.push', PushChannel::class)
78-
->args([service('texter.transports'), service('messenger.default_bus')->ignoreOnInvalid()])
78+
->args([
79+
service('texter.transports'),
80+
abstract_arg('message bus'),
81+
])
7982
->tag('notifier.channel', ['channel' => 'push'])
8083

8184
->set('notifier.channel.desktop', DesktopChannel::class)

src/Symfony/Component/Scheduler/Tests/RecurringMessageTest.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\Scheduler\Tests;
1313

1414
use PHPUnit\Framework\TestCase;
15-
use Random\Randomizer;
1615
use Symfony\Component\Scheduler\Exception\InvalidArgumentException;
1716
use Symfony\Component\Scheduler\RecurringMessage;
1817

@@ -22,13 +21,8 @@ public function testCanCreateHashedCronMessage()
2221
{
2322
$object = new DummyStringableMessage();
2423

25-
if (class_exists(Randomizer::class)) {
26-
$this->assertSame('30 0 * * *', (string) RecurringMessage::cron('#midnight', $object)->getTrigger());
27-
$this->assertSame('30 0 * * 3', (string) RecurringMessage::cron('#weekly', $object)->getTrigger());
28-
} else {
29-
$this->assertSame('36 0 * * *', (string) RecurringMessage::cron('#midnight', $object)->getTrigger());
30-
$this->assertSame('36 0 * * 6', (string) RecurringMessage::cron('#weekly', $object)->getTrigger());
31-
}
24+
$this->assertSame('30 0 * * *', (string) RecurringMessage::cron('#midnight', $object)->getTrigger());
25+
$this->assertSame('30 0 * * 3', (string) RecurringMessage::cron('#weekly', $object)->getTrigger());
3226
}
3327

3428
public function testHashedCronContextIsRequiredIfMessageIsNotStringable()

src/Symfony/Component/Scheduler/Tests/Trigger/CronExpressionTriggerTest.php

Lines changed: 21 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\Scheduler\Tests\Trigger;
1313

1414
use PHPUnit\Framework\TestCase;
15-
use Random\Randomizer;
1615
use Symfony\Component\Scheduler\Trigger\CronExpressionTrigger;
1716

1817
class CronExpressionTriggerTest extends TestCase
@@ -33,54 +32,28 @@ public function testHashedExpressionParsing(string $input, string $expected)
3332

3433
public static function hashedExpressionProvider(): array
3534
{
36-
if (class_exists(Randomizer::class)) {
37-
return [
38-
['# * * * *', '30 * * * *'],
39-
['# # * * *', '30 0 * * *'],
40-
['# # # * *', '30 0 25 * *'],
41-
['# # # # *', '30 0 25 10 *'],
42-
['# # # # #', '30 0 25 10 5'],
43-
['# # 1,15 1-11 *', '30 0 1,15 1-11 *'],
44-
['# # 1,15 * *', '30 0 1,15 * *'],
45-
['#hourly', '30 * * * *'],
46-
['#daily', '30 0 * * *'],
47-
['#weekly', '30 0 * * 3'],
48-
['#weekly@midnight', '30 0 * * 3'],
49-
['#monthly', '30 0 25 * *'],
50-
['#monthly@midnight', '30 0 25 * *'],
51-
['#yearly', '30 0 25 10 *'],
52-
['#yearly@midnight', '30 0 25 10 *'],
53-
['#annually', '30 0 25 10 *'],
54-
['#annually@midnight', '30 0 25 10 *'],
55-
['#midnight', '30 0 * * *'],
56-
['#(1-15) * * * *', '1 * * * *'],
57-
['#(1-15) * * * #(3-5)', '1 * * * 3'],
58-
['#(1-15) * # * #(3-5)', '1 * 17 * 5'],
59-
];
60-
}
61-
6235
return [
63-
['# * * * *', '36 * * * *'],
64-
['# # * * *', '36 0 * * *'],
65-
['# # # * *', '36 0 14 * *'],
66-
['# # # # *', '36 0 14 3 *'],
67-
['# # # # #', '36 0 14 3 5'],
68-
['# # 1,15 1-11 *', '36 0 1,15 1-11 *'],
69-
['# # 1,15 * *', '36 0 1,15 * *'],
70-
['#hourly', '36 * * * *'],
71-
['#daily', '36 0 * * *'],
72-
['#weekly', '36 0 * * 6'],
73-
['#weekly@midnight', '36 0 * * 6'],
74-
['#monthly', '36 0 14 * *'],
75-
['#monthly@midnight', '36 0 14 * *'],
76-
['#yearly', '36 0 14 3 *'],
77-
['#yearly@midnight', '36 0 14 3 *'],
78-
['#annually', '36 0 14 3 *'],
79-
['#annually@midnight', '36 0 14 3 *'],
80-
['#midnight', '36 0 * * *'],
81-
['#(1-15) * * * *', '7 * * * *'],
82-
['#(1-15) * * * #(3-5)', '7 * * * 3'],
83-
['#(1-15) * # * #(3-5)', '7 * 1 * 5'],
36+
['# * * * *', '30 * * * *'],
37+
['# # * * *', '30 0 * * *'],
38+
['# # # * *', '30 0 25 * *'],
39+
['# # # # *', '30 0 25 10 *'],
40+
['# # # # #', '30 0 25 10 5'],
41+
['# # 1,15 1-11 *', '30 0 1,15 1-11 *'],
42+
['# # 1,15 * *', '30 0 1,15 * *'],
43+
['#hourly', '30 * * * *'],
44+
['#daily', '30 0 * * *'],
45+
['#weekly', '30 0 * * 3'],
46+
['#weekly@midnight', '30 0 * * 3'],
47+
['#monthly', '30 0 25 * *'],
48+
['#monthly@midnight', '30 0 25 * *'],
49+
['#yearly', '30 0 25 10 *'],
50+
['#yearly@midnight', '30 0 25 10 *'],
51+
['#annually', '30 0 25 10 *'],
52+
['#annually@midnight', '30 0 25 10 *'],
53+
['#midnight', '30 0 * * *'],
54+
['#(1-15) * * * *', '1 * * * *'],
55+
['#(1-15) * * * #(3-5)', '1 * * * 3'],
56+
['#(1-15) * # * #(3-5)', '1 * 17 * 5'],
8457
];
8558
}
8659

0 commit comments

Comments
 (0)