| 1 | <?php |
||
| 5 | class PushoverReceiver |
||
| 6 | { |
||
| 7 | protected $key; |
||
| 8 | protected $devices = []; |
||
| 9 | |||
| 10 | /** |
||
| 11 | * PushoverReceiver constructor. |
||
| 12 | * @param $key User or group key. |
||
| 13 | */ |
||
| 14 | protected function __construct($key) |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Create new Pushover receiver with an user key. |
||
| 21 | * |
||
| 22 | * @param $userKey Pushover user key. |
||
| 23 | * @return PushoverReceiver |
||
| 24 | */ |
||
| 25 | public static function withUserKey($userKey) |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Create new Pushover receiver with a group key. |
||
| 32 | * |
||
| 33 | * @param $groupKey Pushover group key. |
||
| 34 | * @return PushoverReceiver |
||
| 35 | */ |
||
| 36 | public static function withGroupKey($groupKey) |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Send the message to a specific device. |
||
| 45 | * |
||
| 46 | * @param array|string $device |
||
| 47 | * @return PushoverReceiver |
||
| 48 | */ |
||
| 49 | public function toDevice($device) |
||
| 60 | |||
| 61 | /** |
||
| 62 | * Get array representation of Pushover receiver. |
||
| 63 | * |
||
| 64 | * @return array |
||
| 65 | */ |
||
| 66 | public function toArray() |
||
| 73 | } |
||
| 74 |