| Conditions | 4 |
| Paths | 6 |
| Total Lines | 17 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function copyTo($destination) { |
||
| 20 | Filesystem::checkWritable($destination); |
||
| 21 | if (!file_exists($destination)) { |
||
| 22 | self::create($destination); |
||
| 23 | } |
||
| 24 | |||
| 25 | $files = glob("$this->path/*"); |
||
| 26 | foreach ($files as $file) { |
||
| 27 | $newFile = "$destination/" . basename("$file"); |
||
| 28 | if (is_dir($file)) { |
||
| 29 | self::create($newFile); |
||
| 30 | (new Directory($file))->copyTo($newFile); |
||
| 31 | } else { |
||
| 32 | copy($file, $newFile); |
||
| 33 | } |
||
| 34 | } |
||
| 35 | } |
||
| 36 | |||
| 68 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@returnannotation as described here.