private function directoryContains(Finder $dir, $resource)
    {
        foreach ($dir as $containedResource) {
            /* @var $containedResource \SplFileInfo */
            if (substr($containedResource->getRealPath(), 0, strlen($resource)) == $resource) {
                return true;
            }
        }

        return false;
    }
private function directoryContains(Finder $dir, $resource)
    {
        foreach ($dir as $containedResource) {
            /* @var $containedResource \SplFileInfo */
            if (substr($containedResource->getRealPath(), 0, strlen($resource)) == $resource) {
                return true;
            }
        }

        return false;
    }
private function directoryContains ( Finder $ dir , $ resource ) { foreach ( $ dir as $ containedResource ) { /* @var $containedResource \SplFileInfo */ if ( substr ( $ containedResource -> getRealPath ( ) , 0 , strlen ( $ resource ) ) == $ resource ) { return true ; } } return false ; }
checks if given directory contains given resource

@param   Finder  $dir
@param   string  $resource
@return  bool
checks if given directory contains given resource