Conditions | 3 |
Paths | 3 |
Total Lines | 26 |
Code Lines | 16 |
Lines | 26 |
Ratio | 100 % |
Tests | 15 |
CRAP Score | 3 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
30 | * |
||
31 | * @return string |
||
32 | */ |
||
33 | 6 | protected function getCompressCommand($fromPath, $toPath) |
|
34 | { |
||
35 | 6 | return sprintf("zip %s %s", escapeshellarg($toPath), escapeshellarg($fromPath)); |
|
36 | } |
||
37 | |||
38 | /** |
||
39 | * Get the command line to decompress a file |
||
40 | * |
||
41 | * @param string $fromPath |
||
42 | * @param string $toPath |
||
43 | * |
||
44 | * @return string |
||
45 | */ |
||
46 | 4 | protected function getDecompressCommand($fromPath, $toPath) |
|
47 | { |
||
48 | 4 | return sprintf("unzip -p %s > %s", escapeshellarg($fromPath), escapeshellarg($toPath)); |
|
49 | } |
||
50 | } |
||
51 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.