1 | <?php |
||
25 | class ApnsAdapter extends AbstractAdapter implements SendAdapter, FeedbackAdapter |
||
26 | { |
||
27 | const RESULT_OK = 0; |
||
28 | |||
29 | /** |
||
30 | * Status codes mapping. |
||
31 | * |
||
32 | * @var array |
||
33 | */ |
||
34 | protected static $statusCodes = [ |
||
35 | 0 => 'OK', |
||
36 | 1 => 'Processing Error', |
||
37 | 2 => 'Missing Device Token', |
||
38 | 3 => 'Missing Topic', |
||
39 | 4 => 'Missing Payload', |
||
40 | 5 => 'Invalid Token Size', |
||
41 | 6 => 'Invalid Topic Size', |
||
42 | 7 => 'Invalid Payload Size', |
||
43 | 8 => 'Invalid Token', |
||
44 | 10 => 'Shutdown', |
||
45 | 255 => 'Unknown Error', |
||
46 | ]; |
||
47 | |||
48 | /** |
||
49 | * APNS service builder. |
||
50 | * |
||
51 | * @var \Jgut\Tify\Adapter\Apns\ApnsBuilder |
||
52 | */ |
||
53 | protected $builder; |
||
54 | |||
55 | /** |
||
56 | * @var \ZendService\Apple\Apns\Client\Message |
||
57 | */ |
||
58 | protected $pushClient; |
||
59 | |||
60 | /** |
||
61 | * @var \ZendService\Apple\Apns\Client\Feedback |
||
62 | */ |
||
63 | protected $feedbackClient; |
||
64 | |||
65 | /** |
||
66 | * @param array $parameters |
||
67 | * @param bool $sandbox |
||
68 | * @param \Jgut\Tify\Adapter\Apns\ApnsBuilder $builder |
||
|
|||
69 | * |
||
70 | * @throws \Jgut\Tify\Exception\AdapterException |
||
71 | */ |
||
72 | public function __construct(array $parameters = [], $sandbox = false, ApnsBuilder $builder = null) |
||
91 | |||
92 | /** |
||
93 | * {@inheritdoc} |
||
94 | * |
||
95 | * @throws \InvalidArgumentException |
||
96 | * @throws \Jgut\Tify\Exception\AdapterException |
||
97 | * @throws \RuntimeException |
||
98 | */ |
||
99 | public function send(Notification $notification) |
||
127 | |||
128 | /** |
||
129 | * {@inheritdoc} |
||
130 | * |
||
131 | * @throws \Jgut\Tify\Exception\AdapterException |
||
132 | * @throws \Jgut\Tify\Exception\NotificationException |
||
133 | */ |
||
134 | public function feedback() |
||
158 | |||
159 | /** |
||
160 | * Get opened ServiceClient |
||
161 | * |
||
162 | * @throws \Jgut\Tify\Exception\AdapterException |
||
163 | * |
||
164 | * @return \ZendService\Apple\Apns\Client\Message |
||
165 | */ |
||
166 | protected function getPushClient() |
||
178 | |||
179 | /** |
||
180 | * Get opened ServiceFeedbackClient |
||
181 | * |
||
182 | * @throws \Jgut\Tify\Exception\AdapterException |
||
183 | * |
||
184 | * @return \ZendService\Apple\Apns\Client\Feedback |
||
185 | */ |
||
186 | protected function getFeedbackClient() |
||
198 | |||
199 | /** |
||
200 | * Get push service formatted messages. |
||
201 | * |
||
202 | * @param \Jgut\Tify\Notification $notification |
||
203 | * |
||
204 | * @throws \InvalidArgumentException |
||
205 | * @throws \RuntimeException |
||
206 | * |
||
207 | * @return \ZendService\Apple\Apns\Message |
||
208 | */ |
||
209 | protected function getPushMessages(Notification $notification) |
||
223 | |||
224 | /** |
||
225 | * {@inheritdoc} |
||
226 | */ |
||
227 | protected function getDefinedParameters() |
||
231 | |||
232 | /** |
||
233 | * {@inheritdoc} |
||
234 | */ |
||
235 | protected function getDefaultParameters() |
||
241 | |||
242 | /** |
||
243 | * {@inheritdoc} |
||
244 | */ |
||
245 | protected function getRequiredParameters() |
||
249 | } |
||
250 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.