10000 minor #60342 [Notifier] document the array shape of the content optio… · symfony/symfony@94f4d7a · GitHub
[go: up one dir, main page]

Skip to content

Commit 94f4d7a

Browse files
committed
minor #60342 [Notifier] document the array shape of the content option (xabbuh)
This PR was merged into the 7.3 branch. Discussion ---------- [Notifier] document the array shape of the content option | Q | A | ------------- | --- | Branch? | 7.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | Fix #60140 (comment) | License | MIT but I wonder: is it actually correct that `$content` is an array, according to https://www.w3.org/TR/activitystreams-vocabulary/#dfn-content I would have guessed that it needs to be a string or (if it was an array), we would have to call it `contentMap` in the payload instead Commits ------- 9efc702 document the array shape of the content option
2 parents 830918d + 9efc702 commit 94f4d7a

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

src/Symfony/Component/Notifier/Bridge/Mercure/MercureOptions.php

+32
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,21 @@ final class MercureOptions implements MessageOptionsInterface
2222

2323
/**
2424
* @param string|string[]|null $topics
25+
* @param array{
26+
* badge?: string,
27+
* body?: string,
28+
* data?: mixed,
29+
* dir?: 'auto'|'ltr'|'rtl',
30+
* icon?: string,
31+
* image?: string,
32+
* lang?: string,
33+
* renotify?: bool,
34+
* requireInteraction?: bool,
35+
* silent?: bool,
36+
* tag?: string,
37+
* timestamp?: int,
38+
* vibrate?: int|list<int>,
39+
* }|null $content
2540
*/
2641
public function __construct(
2742
string|array|null $topics = null,
@@ -62,6 +77,23 @@ public function getRetry(): ?int
6277
return $this->retry;
6378
}
6479

80+
/**
81+
* @return array{
82+
* badge?: string,
83+
* body?: string,
84+
* data?: mixed,
85+
* dir?: 'auto'|'ltr'|'rtl',
86+
* icon?: string,
87+
* image?: string,
88+
* lang?: string,
89+
* renotify?: bool,
90+
* requireInteraction?: bool,
91+
* silent?: bool,
92+
* tag?: string,
93+
* timestamp?: int,
94+
* vibrate?: int|list<int>,
95+
* }|null
96+
*/
6597
public function getContent(): ?array
6698
{
6799
return $this->content;

0 commit comments

Comments
 (0)
0