Conditions | 8 |
Paths | 48 |
Total Lines | 27 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 22 |
CRAP Score | 8 |
Changes | 11 | ||
Bugs | 0 | Features | 2 |
1 | <?php |
||
23 | 9 | public function build($options) |
|
24 | { |
||
25 | 9 | $command = $this->path; |
|
26 | |||
27 | 9 | if (isset($options['title'])) { |
|
28 | 9 | $command .= " -t {$options['title']}"; |
|
29 | 9 | } |
|
30 | 9 | if (isset($options['message'])) { |
|
31 | 9 | $command .= " -m {$options['message']}"; |
|
32 | 9 | } |
|
33 | 9 | if (isset($options['image'])) { |
|
34 | 3 | $pathInfo = pathinfo($options['image']); |
|
35 | 3 | if (isset($pathInfo['extension'])) { |
|
36 | 3 | $command .= " --image {$options['image']}"; |
|
37 | 3 | } else { |
|
38 | 3 | $command .= " -a {$options['image']}"; |
|
39 | } |
||
40 | 3 | } |
|
41 | 9 | if (isset($options['url'])) { |
|
42 | 3 | $command .= " --url {$options['url']}"; |
|
43 | 3 | } |
|
44 | 9 | if (isset($options['sticky']) && $options['sticky'] === true) { |
|
45 | 6 | $command .= ' -s'; |
|
46 | 6 | } |
|
47 | |||
48 | 9 | return $command; |
|
49 | } |
||
50 | } |
||
51 |