Helper/File.php
public function deleteDir($path)
    {
        if (strpos($path, $this->directoryList->getPath('var')) === false) {
            return sprintf("Failed to delete directory - '%s'", $path);
        }

        $classFunc = [__CLASS__, __FUNCTION__];
        return is_file($path)
            ?
            @unlink($path)
            :
            array_map($classFunc, glob($path . '/*')) == @rmdir($path);
    }
public function deleteDir($path)
    {
        if (strpos($path, $this->directoryList->getPath('var')) === false) {
            return sprintf("Failed to delete directory - '%s'", $path);
        }

        $classFunc = [__CLASS__, __FUNCTION__];
        return is_file($path)
            ?
            @unlink($path)
            :
            array_map($classFunc, glob($path . '/*')) == @rmdir($path);
    }
public function deleteDir ( $ path ) { if ( strpos ( $ path , $ this -> directoryList -> getPath ( 'var' ) ) === false ) { return sprintf ( "Failed to delete directory - '%s'" , $ path ) ; } $ classFunc = [ __CLASS__ , __FUNCTION__ ] ; return is_file ( $ path ) ? @ unlink ( $ path ) : array_map ( $ classFunc , glob ( $ path . '/*' ) ) == @ rmdir ( $ path ) ; }
Delete file or directory.

@param string $path

@return bool
Delete file or directory .