simplify if statement (#25188)

This commit is contained in:
Michał Putkowski 2018-08-13 16:51:11 +02:00 committed by Taylor Otwell
parent d8433be23d
commit 445c4f7886
1 changed files with 2 additions and 4 deletions

View File

@ -452,10 +452,8 @@ class Filesystem
*/
public function moveDirectory($from, $to, $overwrite = false)
{
if ($overwrite && $this->isDirectory($to)) {
if (! $this->deleteDirectory($to)) {
return false;
}
if ($overwrite && $this->isDirectory($to) && ! $this->deleteDirectory($to)) {
return false;
}
return @rename($from, $to) === true;