Skip to content

Commit a068a5f

Browse files
authored
Merge pull request #146 from norkunas/add-app-url-option
Add app_url option in NotificationResolver
2 parents d5f6287 + 2afcefe commit a068a5f

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## Version 2.3.0
4+
5+
- Add app_url option in NotificationResolver
6+
37
## Version 2.2.0
48

59
- Add channel_for_external_user_ids option in NotificationResolver

src/Resolver/NotificationResolver.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ public function resolve(array $data): array
164164
->setAllowedValues('web_url', function (string $value) {
165165
return $this->filterUrl($value);
166166
})
167+
->setDefined('app_url')
168+
->setAllowedTypes('app_url', 'string')
167169
->setDefined('send_after')
168170
->setAllowedTypes('send_after', DateTimeInterface::class)
169171
->setNormalizer('send_after', function (Options $options, DateTimeInterface $value) {

tests/Resolver/NotificationResolverTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ public function testResolveWithValidValues(): void
9292
'firefox_icon' => 'value',
9393
'url' => 'http://url.com',
9494
'web_url' => 'http://url.com',
95+
'app_url' => 'myapp://path',
9596
'send_after' => new DateTime(),
9697
'delayed_option' => 'timezone',
9798
'delivery_time_of_day' => new DateTime(),
@@ -188,6 +189,7 @@ public function wrongValueTypesProvider(): iterable
188189
yield [['firefox_icon' => 666]];
189190
yield [['url' => 666]];
190191
yield [['web_url' => 666]];
192+
yield [['app_url' => 666]];
191193
yield [['send_after' => 666]];
192194
yield [['delayed_option' => 666]];
193195
yield [['delivery_time_of_day' => 666]];

0 commit comments

Comments
 (0)