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);
}
}