protected function truncateDirectory($dirname, Filesystem $filesystem)
    {
        if ($dirname
            && ltrim(dirname($dirname), '.')
            && !$this->config()->get('keep_empty_dirs')
            && !$filesystem->listContents($dirname)
        ) {
            $filesystem->deleteDir($dirname);
        }
    }
protected function truncateDirectory($dirname, Filesystem $filesystem)
    {
        if ($dirname
            && ltrim(dirname($dirname), '.')
            && !$this->config()->get('keep_empty_dirs')
            && !$filesystem->listContents($dirname)
        ) {
            $filesystem->deleteDir($dirname);
        }
    }
protected function truncateDirectory ( $ dirname , Filesystem $ filesystem ) { if ( $ dirname && ltrim ( dirname ( $ dirname ) , '.' ) && ! $ this -> config ( ) -> get ( 'keep_empty_dirs' ) && ! $ filesystem -> listContents ( $ dirname ) ) { $ filesystem -> deleteDir ( $ dirname ) ; } }
Clear directory if it's empty

@param string $dirname Name of directory
@param Filesystem $filesystem
Clear directory if it s empty