protected function filterPath($path, $pattern, array $extensions=[])
    {
        $usePattern = $this->isFilterPattern($pattern);

        if (!$usePattern && !$extensions) {
            return true;
        }

        if ($usePattern && !fnmatch($pattern, $this->basename($path))) {
            return false;
        }

        if ($extensions && !in_array(strtolower($this->extension($path)), $extensions)) {
            return false;
        }

        return true;
    }
protected function filterPath($path, $pattern, array $extensions=[])
    {
        $usePattern = $this->isFilterPattern($pattern);

        if (!$usePattern && !$extensions) {
            return true;
        }

        if ($usePattern && !fnmatch($pattern, $this->basename($path))) {
            return false;
        }

        if ($extensions && !in_array(strtolower($this->extension($path)), $extensions)) {
            return false;
        }

        return true;
    }
protected function filterPath ( $ path , $ pattern , array $ extensions = [ ] ) { $ usePattern = $ this -> isFilterPattern ( $ pattern ) ; if ( ! $ usePattern && ! $ extensions ) { return true ; } if ( $ usePattern && ! fnmatch ( $ pattern , $ this -> basename ( $ path ) ) ) { return false ; } if ( $ extensions && ! in_array ( strtolower ( $ this -> extension ( $ path ) ) , $ extensions ) ) { return false ; } return true ; }
Apply the filter on a single path.

@param string $path
@param string $pattern
@param array  $extensions [optional]

@return bool
Apply the filter on a single path .