1 | <?php |
||
13 | class ApnChannel |
||
14 | { |
||
15 | use InteractsWithConnection; |
||
16 | |||
17 | /** |
||
18 | * The sandbox environment identifier. |
||
19 | * |
||
20 | * @var int |
||
21 | */ |
||
22 | const SANDBOX = 0; |
||
23 | |||
24 | /** |
||
25 | * The production environment identifier. |
||
26 | * |
||
27 | * @var int |
||
28 | */ |
||
29 | const PRODUCTION = 1; |
||
30 | |||
31 | /** @var \ZendService\Apple\Apns\Client\Message */ |
||
32 | protected $client; |
||
33 | |||
34 | /** @var \Illuminate\Events\Dispatcher */ |
||
35 | protected $events; |
||
36 | |||
37 | /** @var \NotificationChannels\Apn\ApnCredentials */ |
||
38 | protected $credentials; |
||
39 | |||
40 | /** |
||
41 | * Create a new instance of the APN channel. |
||
42 | * |
||
43 | * @param \ZendService\Apple\Apns\Client\Message $client |
||
44 | * @param \Illuminate\Events\Dispatcher $events |
||
45 | * @param \NotificationChannels\Apn\ApnCredentials $credentials |
||
46 | */ |
||
47 | 2 | public function __construct( |
|
58 | |||
59 | /** |
||
60 | * Send the notification to Apple Push Notification Service. |
||
61 | * |
||
62 | * @param mixed $notifiable |
||
63 | * @param \Illuminate\Notifications\Notification $notification |
||
64 | */ |
||
65 | 2 | public function send($notifiable, Notification $notification) |
|
79 | |||
80 | /** |
||
81 | * Send the notification to each of the provided tokens. |
||
82 | * |
||
83 | * @param mixed $notifiable |
||
84 | * @param \Illuminate\Notifications\Notification $notification |
||
85 | */ |
||
86 | 2 | protected function sendNotifications($notifiable, $notification, $tokens, $message) |
|
101 | |||
102 | /** |
||
103 | * Sent the notification to the given token. |
||
104 | * |
||
105 | * @param mixed $notifiable |
||
106 | * @param \Illuminate\Notifications\Notification $notification |
||
107 | * @param \ZendService\Apple\Apns\Message $message |
||
108 | * @param string $token |
||
109 | * @return void |
||
110 | * @throws \NotificationChannels\Apn\Exceptions\SendingFailed |
||
111 | */ |
||
112 | 2 | protected function sendNotification($notifiable, $notification, $message, $token) |
|
129 | } |
||
130 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: