$list =
[];
} foreach ($list as $item) { if ($item == '.' ||
$item == '..'
) { continue;
} if (@
ftp_chdir($this->connection,
$item)) { ftp_cdup($this->connection
);
$this->
removeDirectory(ftp_pwd($this->connection
) . '/' .
$item);
} else { $this->
removeFile(ftp_pwd($this->connection
) . '/' .
$item);
} } ftp_chdir($this->connection,
$pwd);
if (!
ftp_rmdir($this->connection,
$directory)) { throw new FileTransferException("Unable to remove the directory @directory", 0,
['@directory' =>
$directory]);
} } /**
* {@inheritdoc}
*/