1 | <?php |
||
14 | class ApnChannel |
||
15 | { |
||
16 | /** |
||
17 | * The Pushok Client instance. |
||
18 | * |
||
19 | * @var \Pushok\Client |
||
20 | */ |
||
21 | protected $client; |
||
22 | |||
23 | /** |
||
24 | * Create an instance of APN channel. |
||
25 | * |
||
26 | * @param \Pushok\Client $client |
||
27 | * @return void |
||
|
|||
28 | */ |
||
29 | public function __construct(Client $client) |
||
33 | |||
34 | /** |
||
35 | * Send the given notification. |
||
36 | * |
||
37 | * @param mixed $notifiable |
||
38 | * @param \Illuminate\Notifications\Notification $notification |
||
39 | * @return void |
||
40 | * |
||
41 | * @throws \SemyonChetvertnyh\ApnNotificationChannel\Exceptions\InvalidPayloadException |
||
42 | * @throws \SemyonChetvertnyh\ApnNotificationChannel\Exceptions\CouldNotSendNotification |
||
43 | */ |
||
44 | public function send($notifiable, Notification $notification) |
||
62 | |||
63 | /** |
||
64 | * Format an array with notifications. |
||
65 | * |
||
66 | * @param \SemyonChetvertnyh\ApnNotificationChannel\ApnMessage $message |
||
67 | * @param \Illuminate\Contracts\Support\Arrayable|array $deviceTokens |
||
68 | * @return \Pushok\Notification[] |
||
69 | */ |
||
70 | protected function notifications(ApnMessage $message, $deviceTokens) |
||
78 | |||
79 | /** |
||
80 | * Format a payload. |
||
81 | * |
||
82 | * @param \SemyonChetvertnyh\ApnNotificationChannel\ApnMessage $message |
||
83 | * @return \Pushok\Payload |
||
84 | * |
||
85 | * @throws \SemyonChetvertnyh\ApnNotificationChannel\Exceptions\InvalidPayloadException |
||
86 | */ |
||
87 | protected function payload(ApnMessage $message) |
||
126 | |||
127 | /** |
||
128 | * Format an alert. |
||
129 | * |
||
130 | * @param \SemyonChetvertnyh\ApnNotificationChannel\ApnMessage $message |
||
131 | * @return \Pushok\Payload\Alert |
||
132 | */ |
||
133 | protected function alert(ApnMessage $message) |
||
175 | } |
||
176 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.