1 | <?php |
||
24 | class ApnsService extends AbstractService implements SendInterface, FeedbackInterface |
||
25 | { |
||
26 | const RESULT_OK = 0; |
||
27 | |||
28 | /** |
||
29 | * Status codes mapping. |
||
30 | * |
||
31 | * @var array |
||
32 | */ |
||
33 | private static $statusCodes = [ |
||
34 | 0 => 'OK', |
||
35 | 1 => 'Processing Error', |
||
36 | 2 => 'Missing Recipient Token', |
||
37 | 3 => 'Missing Topic', |
||
38 | 4 => 'Missing Payload', |
||
39 | 5 => 'Invalid Token Size', |
||
40 | 6 => 'Invalid Topic Size', |
||
41 | 7 => 'Invalid Payload Size', |
||
42 | 8 => 'Invalid Token', |
||
43 | 10 => 'Shutdown', |
||
44 | 255 => 'Unknown Error', |
||
45 | ]; |
||
46 | |||
47 | /** |
||
48 | * @var \ZendService\Apple\Apns\Client\Message |
||
49 | */ |
||
50 | protected $pushClient; |
||
51 | |||
52 | /** |
||
53 | * @var \ZendService\Apple\Apns\Client\Feedback |
||
54 | */ |
||
55 | protected $feedbackClient; |
||
56 | |||
57 | /** |
||
58 | * {@inheritdoc} |
||
59 | * |
||
60 | * @throws \Jgut\Tify\Exception\ServiceException |
||
61 | */ |
||
62 | public function __construct(array $parameters = [], $sandbox = false) |
||
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | * |
||
78 | * @throws \InvalidArgumentException |
||
79 | */ |
||
80 | public function send(AbstractNotification $notification) |
||
116 | |||
117 | /** |
||
118 | * {@inheritdoc} |
||
119 | * |
||
120 | * @throws \Jgut\Tify\Exception\NotificationException |
||
121 | */ |
||
122 | public function feedback() |
||
146 | |||
147 | /** |
||
148 | * Get opened ServiceClient |
||
149 | * |
||
150 | * @return \ZendService\Apple\Apns\Client\Message |
||
151 | */ |
||
152 | protected function getPushService() |
||
164 | |||
165 | /** |
||
166 | * Get opened ServiceFeedbackClient |
||
167 | * |
||
168 | * @return \ZendService\Apple\Apns\Client\Feedback |
||
169 | */ |
||
170 | protected function getFeedbackService() |
||
182 | |||
183 | /** |
||
184 | * {@inheritdoc} |
||
185 | */ |
||
186 | protected function getDefinedParameters() |
||
190 | |||
191 | /** |
||
192 | * {@inheritdoc} |
||
193 | */ |
||
194 | protected function getDefaultParameters() |
||
200 | |||
201 | /** |
||
202 | * {@inheritdoc} |
||
203 | */ |
||
204 | protected function getRequiredParameters() |
||
208 | } |
||
209 |
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.