private function getDirectories($dir, $directoryName = null)
    {
        $finder = new Finder();
        $finder->directories()->in($dir);

        if (null !== $directoryName) {
            $finder->name($directoryName);
        }

        if (iterator_count($finder) > 0) {
            return iterator_to_array($finder);
        }

        return false;
    }
private function getDirectories($dir, $directoryName = null)
    {
        $finder = new Finder();
        $finder->directories()->in($dir);

        if (null !== $directoryName) {
            $finder->name($directoryName);
        }

        if (iterator_count($finder) > 0) {
            return iterator_to_array($finder);
        }

        return false;
    }
private function getDirectories ( $ dir , $ directoryName = null ) { $ finder = new Finder ( ) ; $ finder -> directories ( ) -> in ( $ dir ) ; if ( null !== $ directoryName ) { $ finder -> name ( $ directoryName ) ; } if ( iterator_count ( $ finder ) > 0 ) { return iterator_to_array ( $ finder ) ; } return false ; }
Get directories.

@param string $dir           Where to search
@param string $directoryName The directory name you want to find

@return array|bool
Get directories .