Total Complexity | 5 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | class Pushbullet |
||
6 | { |
||
7 | public function push($api_key, $subject, $content, $url) |
||
8 | { |
||
9 | $push = new \GJClasses\Push('pushbullet'); |
||
10 | $type = $push->getPushType($url); |
||
11 | |||
12 | if ($type == 'note') { |
||
13 | |||
14 | $message = $this->pushNote($api_key, $subject, $content); |
||
15 | |||
16 | } elseif ($type == 'url') { |
||
17 | |||
18 | $message = $this->pushUrl($api_key, $subject, $content, $url); |
||
19 | |||
20 | } else { |
||
21 | |||
22 | $message = 'Push type incorrect or not specified'; |
||
23 | |||
24 | } |
||
25 | |||
26 | return $message; |
||
27 | } |
||
28 | |||
29 | public function pushNote($api_key, $subject, $content) |
||
34 | } |
||
35 | |||
36 | public function pushUrl($api_key, $subject, $content, $url) |
||
41 | } |
||
42 | } |
||
43 |