@@ 49-56 (lines=8) @@ | ||
46 | * @throws FileNotReadableException |
|
47 | * @throws FilesystemException |
|
48 | */ |
|
49 | public function copyTo(string $destination, int $overwrite = self::OVERWRITE_MERGE): void |
|
50 | { |
|
51 | if(file_exists($destination) && ($overwrite & self::OVERWRITE_SKIP)) { |
|
52 | return; |
|
53 | } |
|
54 | Filesystem::directory($destination)->createIfNotExists(true); |
|
55 | $this->getFiles()->copyTo($destination, $overwrite); |
|
56 | } |
|
57 | ||
58 | /** |
|
59 | * Recursively get the size of all contents in the directory. |
|
@@ 80-89 (lines=10) @@ | ||
77 | * @throws FileNotReadableException |
|
78 | * @throws FilesystemException |
|
79 | */ |
|
80 | public function moveTo(string $destination, int $overwrite = self::OVERWRITE_MERGE) : void |
|
81 | { |
|
82 | if(file_exists($destination) && ($overwrite & self::OVERWRITE_SKIP)) { |
|
83 | return; |
|
84 | } |
|
85 | Filesystem::directory($destination)->createIfNotExists(true); |
|
86 | $this->getFiles()->moveTo($destination, $overwrite); |
|
87 | $this->delete(); |
|
88 | $this->path = $destination; |
|
89 | } |
|
90 | ||
91 | /** |
|
92 | * Create the directory pointed to by path. |