protected function removeDir(\SplFileInfo $dir, $alsoRemoveFiles = true)
{
// clean up the directory
$this->getService()->cleanUpDir($dir, $alsoRemoveFiles);
// check if the directory exists, if not return immediately
if ($dir->isDir() === false) {
return;
}
// delete the directory itself if empty
@rmdir($dir->getPathname());
}