public static function removeDir(string $path): void
    {
        self::walkDir(
            $path,
            function (SplFileInfo $file): void
            {
                $path = $file->getRealPath();
                $file->isDir() ? rmdir($path) : unlink($path);
            }
        );
        rmdir($path);
    }
public static function removeDir(string $path): void
    {
        self::walkDir(
            $path,
            function (SplFileInfo $file): void
            {
                $path = $file->getRealPath();
                $file->isDir() ? rmdir($path) : unlink($path);
            }
        );
        rmdir($path);
    }
public static function removeDir ( string $ path ) : void { self :: walkDir ( $ path , function ( SplFileInfo $ file ) : void { $ path = $ file -> getRealPath ( ) ; $ file -> isDir ( ) ? rmdir ( $ path ) : unlink ( $ path ) ; } ) ; rmdir ( $ path ) ; }
Removes directory recursively.

Don't forget to call {@see http://php.net/manual/en/function.clearstatcache.php php://clearstatcache()}
after using this method if required.

@param string $path

@return void

@see http://php.net/manual/en/function.clearstatcache.php  php://clearstatcache()
Removes directory recursively .