public function delTree($dir)
    {
        if (! file_exists($dir)) {
            return false;
        }

        $files = array_diff(scandir($dir), ['.', '..']);

        $this->deleteAllFiles($dir, $files);

        return rmdir($dir);
    }
public function delTree($dir)
    {
        if (! file_exists($dir)) {
            return false;
        }

        $files = array_diff(scandir($dir), ['.', '..']);

        $this->deleteAllFiles($dir, $files);

        return rmdir($dir);
    }
public function delTree ( $ dir ) { if ( ! file_exists ( $ dir ) ) { return false ; } $ files = array_diff ( scandir ( $ dir ) , [ '.' , '..' ] ) ; $ this -> deleteAllFiles ( $ dir , $ files ) ; return rmdir ( $ dir ) ; }
Delete a directory and all its files.

@param $dir
@return bool
Delete a directory and all its files .