public function getUsedStorage(Workspace $workspace)
    {
        $dir = $this->getStorageDirectory($workspace);
        $size = 0;

        if (!is_dir($dir)) {
            return $size;
        }

        foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($dir)) as $file) {
            $size += $file->getSize();
        }

        return $size;
    }
public function getUsedStorage(Workspace $workspace)
    {
        $dir = $this->getStorageDirectory($workspace);
        $size = 0;

        if (!is_dir($dir)) {
            return $size;
        }

        foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($dir)) as $file) {
            $size += $file->getSize();
        }

        return $size;
    }
public function getUsedStorage ( Workspace $ workspace ) { $ dir = $ this -> getStorageDirectory ( $ workspace ) ; $ size = 0 ; if ( ! is_dir ( $ dir ) ) { return $ size ; } foreach ( new \ RecursiveIteratorIterator ( new \ RecursiveDirectoryIterator ( $ dir ) ) as $ file ) { $ size += $ file -> getSize ( ) ; } return $ size ; }
Get the current used storage in a workspace.

@param Workspace $workspace

@return int
Get the current used storage in a workspace .