isDir() && ! $item->isLink() ? @rmdir($item->getPathname()) : @unlink($item->getPathname()); } @rmdir($dir); } }