1 | <?php |
||
21 | class Apns extends AbstractService implements SendInterface, FeedbackInterface |
||
22 | { |
||
23 | const RESULT_OK = 0; |
||
24 | |||
25 | /** |
||
26 | * Status codes translation. |
||
27 | * |
||
28 | * @var array |
||
29 | */ |
||
30 | private static $statusCodes = [ |
||
31 | 0 => 'OK', |
||
32 | 1 => 'Processing Error', |
||
33 | 2 => 'Missing Recipient Token', |
||
34 | 3 => 'Missing Topic', |
||
35 | 4 => 'Missing Payload', |
||
36 | 5 => 'Invalid Token Size', |
||
37 | 6 => 'Invalid Topic Size', |
||
38 | 7 => 'Invalid Payload Size', |
||
39 | 8 => 'Invalid Token', |
||
40 | 10 => 'Shutdown', |
||
41 | 255 => 'Unknown Error', |
||
42 | ]; |
||
43 | |||
44 | /** |
||
45 | * @var \ZendService\Apple\Apns\Client\Message |
||
46 | */ |
||
47 | protected $pushClient; |
||
48 | |||
49 | /** |
||
50 | * @var \ZendService\Apple\Apns\Client\Feedback |
||
51 | */ |
||
52 | protected $feedbackClient; |
||
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | * |
||
57 | * @throws \Jgut\Tify\Exception\ServiceException |
||
58 | */ |
||
59 | public function __construct(array $parameters = [], $sandbox = false) |
||
69 | |||
70 | /** |
||
71 | * {@inheritdoc} |
||
72 | * |
||
73 | * @throws \InvalidArgumentException |
||
74 | */ |
||
75 | public function send(AbstractNotification $notification) |
||
111 | |||
112 | /** |
||
113 | * {@inheritdoc} |
||
114 | * |
||
115 | * @throws \Jgut\Tify\Exception\NotificationException |
||
116 | */ |
||
117 | public function feedback() |
||
140 | |||
141 | /** |
||
142 | * Get opened ServiceClient |
||
143 | * |
||
144 | * @return \ZendService\Apple\Apns\Client\Message |
||
145 | */ |
||
146 | protected function getPushService() |
||
158 | |||
159 | /** |
||
160 | * Get opened ServiceFeedbackClient |
||
161 | * |
||
162 | * @return \ZendService\Apple\Apns\Client\Feedback |
||
163 | */ |
||
164 | protected function getFeedbackService() |
||
176 | |||
177 | /** |
||
178 | * {@inheritdoc} |
||
179 | */ |
||
180 | protected function getDefinedParameters() |
||
184 | |||
185 | /** |
||
186 | * {@inheritdoc} |
||
187 | */ |
||
188 | protected function getDefaultParameters() |
||
194 | |||
195 | /** |
||
196 | * {@inheritdoc} |
||
197 | */ |
||
198 | protected function getRequiredParameters() |
||
202 | } |
||
203 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.