1 | <?php |
||
23 | class Response implements ResponseInterface |
||
24 | { |
||
25 | const REQUEST_HAS_SUCCEED_CODE = 200; |
||
26 | const MALFORMED_NOTIFICATION_CODE = 400; |
||
27 | const AUTHENTICATION_ERROR_CODE = 401; |
||
28 | const INVALID_RECIPIENT_ERROR_CODE = 404; |
||
29 | const INVALID_METHOD_ERROR_CODE = 405; |
||
30 | const QUOTA_EXCEEDED_ERROR_CODE = 406; |
||
31 | const DEVICE_INACTIVE_ERROR_CODE = 412; |
||
32 | const SERVER_UNAVAILABLE_ERROR_CODE = 503; |
||
33 | |||
34 | /** |
||
35 | * @var \Buzz\Message\Response |
||
36 | */ |
||
37 | protected $response; |
||
38 | |||
39 | /** |
||
40 | * @var \ArrayIterator |
||
41 | */ |
||
42 | protected $recipients; |
||
43 | |||
44 | /** |
||
45 | * @param \Buzz\Message\Response $response |
||
46 | * @param \ArrayIterator $recipients |
||
47 | */ |
||
48 | public function __construct(\Buzz\Message\Response $response, \ArrayIterator $recipients) |
||
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | public function processResponse() |
||
62 | |||
63 | /** |
||
64 | * Checks if response has succeed code or request was rejected |
||
65 | * |
||
66 | * @param int $responseCode |
||
67 | * @param \ArrayIterator $recipients |
||
68 | * @throws \Zbox\UnifiedPush\Exception\MalformedNotificationException |
||
69 | * @throws \Zbox\UnifiedPush\Exception\DispatchMessageException |
||
70 | * @throws \Zbox\UnifiedPush\Exception\RuntimeException |
||
71 | */ |
||
72 | private function checkResponseCode($responseCode, \ArrayIterator $recipients) |
||
122 | } |
||
123 |