1 | <?php |
||
17 | class ApnChannel |
||
18 | { |
||
19 | const SANDBOX = 0; |
||
20 | const PRODUCTION = 1; |
||
21 | |||
22 | /** @var string */ |
||
23 | protected $environment; |
||
24 | |||
25 | /** @var string */ |
||
26 | protected $certificate; |
||
27 | |||
28 | /** @var string|null */ |
||
29 | protected $passPhrase; |
||
30 | |||
31 | /** @var \ZendService\Apple\Apns\Client\Message */ |
||
32 | protected $client; |
||
33 | |||
34 | /** @var \ZendService\Apple\Apns\Client\Feedback */ |
||
35 | protected $feedbackClient; |
||
36 | |||
37 | /** @var \Illuminate\Events\Dispatcher */ |
||
38 | protected $events; |
||
39 | |||
40 | /** |
||
41 | * @param \ZendService\Apple\Apns\Client\Message $client |
||
42 | * @param \ZendService\Apple\Apns\Client\Feedback $feedbackClient |
||
43 | * @param \Illuminate\Events\Dispatcher $events |
||
44 | * @param string $environment |
||
45 | * @param string $certificate |
||
46 | * @param string|null $passPhrase |
||
47 | */ |
||
48 | 2 | public function __construct( |
|
63 | |||
64 | /** |
||
65 | * Send the notification to Apple Push Notification Service. |
||
66 | * |
||
67 | * @param mixed $notifiable |
||
68 | * @param \Illuminate\Notifications\Notification $notification |
||
69 | * |
||
70 | * @throws \NotificationChannels\Apn\Exceptions\SendingFailed |
||
71 | */ |
||
72 | 1 | public function send($notifiable, Notification $notification) |
|
117 | |||
118 | /** |
||
119 | * Get feedback from the Apple Feedback Service about failed deliveries |
||
120 | * |
||
121 | * @return array|ApnFeedback[] |
||
122 | * @throws Exceptions\ConnectionFailed |
||
123 | */ |
||
124 | 1 | public function getFeedback() |
|
145 | |||
146 | /** |
||
147 | * Open the connection. |
||
148 | * |
||
149 | * @throws \NotificationChannels\Apn\Exceptions\ConnectionFailed |
||
150 | */ |
||
151 | 1 | private function openConnection() |
|
159 | |||
160 | /** |
||
161 | * Close the connection. |
||
162 | */ |
||
163 | 1 | private function closeConnection() |
|
167 | } |
||
168 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.