Conditions | 4 |
Paths | 6 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
32 | public function compress($source, $target = '') |
||
33 | { |
||
34 | $target = $target ?: $source.'.zip'; |
||
35 | |||
36 | if ($this->zip->open($target) === false) { |
||
37 | return false; |
||
38 | } |
||
39 | |||
40 | if ($this->zip->addFile($source, basename($source)) == false) { |
||
41 | $this->zip->close(); |
||
42 | return false; |
||
43 | } |
||
44 | |||
45 | return $this->zip->close(); |
||
46 | } |
||
47 | } |
||
48 |