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