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