1 | <?php |
||
18 | class Notification |
||
19 | { |
||
20 | use ParameterTrait; |
||
21 | |||
22 | /** |
||
23 | * Default notification parameters. |
||
24 | * |
||
25 | * @see https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG |
||
26 | * /Chapters/TheNotificationPayload.html |
||
27 | * @see https://developers.google.com/cloud-messaging/http-server-ref#downstream-http-messages-json |
||
28 | * |
||
29 | * @var array |
||
30 | */ |
||
31 | protected $defaultParameters = [ |
||
32 | // APNS |
||
33 | 'badge' => null, |
||
34 | 'sound' => null, |
||
35 | 'content_available' => null, |
||
36 | 'category' => null, |
||
37 | 'url-args' => null, |
||
38 | 'expire' => null, |
||
39 | |||
40 | // GCM |
||
41 | 'collapse_key' => null, |
||
42 | 'delay_while_idle' => null, |
||
43 | 'time_to_live' => 2419200, |
||
44 | 'restricted_package_name' => null, |
||
45 | 'dry_run' => null, |
||
46 | ]; |
||
47 | |||
48 | /** |
||
49 | * @var \Jgut\Tify\Message |
||
50 | */ |
||
51 | protected $message; |
||
52 | |||
53 | /** |
||
54 | * @var \Jgut\Tify\Receiver\AbstractReceiver[] |
||
55 | */ |
||
56 | protected $receivers = []; |
||
57 | |||
58 | /** |
||
59 | * Notification results. |
||
60 | * |
||
61 | * @var \Jgut\Tify\Result[] |
||
62 | */ |
||
63 | protected $results; |
||
64 | |||
65 | /** |
||
66 | * Notification constructor. |
||
67 | * |
||
68 | * @param \Jgut\Tify\Message $message |
||
69 | * @param \Jgut\Tify\Receiver\ApnsReceiver[] $receivers |
||
70 | * @param array $parameters |
||
71 | * |
||
72 | * @throws \InvalidArgumentException |
||
73 | */ |
||
74 | public function __construct(Message $message, array $receivers = [], array $parameters = []) |
||
86 | |||
87 | /** |
||
88 | * Get message. |
||
89 | * |
||
90 | * @return \Jgut\Tify\Message |
||
91 | */ |
||
92 | public function getMessage() |
||
96 | |||
97 | /** |
||
98 | * Set message. |
||
99 | * |
||
100 | * @param \Jgut\Tify\Message $message |
||
101 | * |
||
102 | * @throws \InvalidArgumentException |
||
103 | * |
||
104 | * @return $this |
||
105 | */ |
||
106 | public function setMessage(Message $message) |
||
112 | |||
113 | /** |
||
114 | * Retrieve list of receivers. |
||
115 | * |
||
116 | * @return \Jgut\Tify\Receiver\AbstractReceiver[] |
||
117 | */ |
||
118 | public function getReceivers() |
||
122 | |||
123 | /** |
||
124 | * Add receiver. |
||
125 | * |
||
126 | * @param \Jgut\Tify\Receiver\AbstractReceiver $receiver |
||
127 | * |
||
128 | * @return $this |
||
129 | */ |
||
130 | public function addReceiver(AbstractReceiver $receiver) |
||
136 | |||
137 | /** |
||
138 | * Remove all receivers. |
||
139 | * |
||
140 | * @return $this |
||
141 | */ |
||
142 | public function clearReceivers() |
||
148 | |||
149 | /** |
||
150 | * Retrieve results. |
||
151 | * |
||
152 | * @return \Jgut\Tify\Result[] |
||
153 | */ |
||
154 | public function getResults() |
||
158 | |||
159 | /** |
||
160 | * Add push result. |
||
161 | * |
||
162 | * @param \Jgut\Tify\Result $result |
||
163 | */ |
||
164 | public function addResult(Result $result) |
||
168 | |||
169 | /** |
||
170 | * Clear push results. |
||
171 | * |
||
172 | * @return $this |
||
173 | */ |
||
174 | public function clearResults() |
||
180 | } |
||
181 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..