public function accept()
    {
        if ($this->mode & self::FILTER_BY_PATH) {
            $value = $this->getCurrentResource()->getPath();
        } else {
            $value = $this->getCurrentResource()->getName();
        }

        if ($this->mode & self::MATCH_PREFIX) {
            return 0 === strpos($value, $this->pattern);
        } elseif ($this->mode & self::MATCH_SUFFIX) {
            return $this->pattern === substr($value, -$this->patternLength);
        } else {
            return preg_match($this->pattern, $value);
        }
    }
public function accept()
    {
        if ($this->mode & self::FILTER_BY_PATH) {
            $value = $this->getCurrentResource()->getPath();
        } else {
            $value = $this->getCurrentResource()->getName();
        }

        if ($this->mode & self::MATCH_PREFIX) {
            return 0 === strpos($value, $this->pattern);
        } elseif ($this->mode & self::MATCH_SUFFIX) {
            return $this->pattern === substr($value, -$this->patternLength);
        } else {
            return preg_match($this->pattern, $value);
        }
    }
public function accept ( ) { if ( $ this -> mode & self :: FILTER_BY_PATH ) { $ value = $ this -> getCurrentResource ( ) -> getPath ( ) ; } else { $ value = $ this -> getCurrentResource ( ) -> getName ( ) ; } if ( $ this -> mode & self :: MATCH_PREFIX ) { return 0 === strpos ( $ value , $ this -> pattern ) ; } elseif ( $ this -> mode & self :: MATCH_SUFFIX ) { return $ this -> pattern === substr ( $ value , - $ this -> patternLength ) ; } else { return preg_match ( $ this -> pattern , $ value ) ; } }
Returns whether the current element should be accepted.

@return bool|int Returns `false` if the current element should be filtered out.
Returns whether the current element should be accepted .