isDot()) { if ($object->isDir()) { delete_directory($object->getPathname()); } else { unlink($object->getPathname()); } } } rmdir($dirPath); } else { throw new Exception(__FUNCTION__ . '(dirPath): dirPath is not a directory!'); } }