| Conditions | 4 |
| Paths | 8 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 32 | 4 | public function copy($source, $destination) |
|
| 33 | { |
||
| 34 | 4 | if (!is_file($source)) { |
|
| 35 | $this->error("Source file '$source' does not exists."); |
||
| 36 | } |
||
| 37 | 4 | if (is_file($destination)) { |
|
| 38 | $this->error("Destination file '$destination' already exists."); |
||
| 39 | } |
||
| 40 | 4 | $result = copy($source, $destination); |
|
| 41 | 4 | if (!$result) { |
|
| 42 | $this->error("Cannot create file '$destination'."); |
||
| 43 | } |
||
| 44 | 4 | } |
|
| 45 | |||
| 67 | } |