protected function _matches($filter, $url) { if (is_string($filter)) { return (bool) preg_match($filter, $url); } if (is_callable($filter)) { return call_user_func($filter, $url); } return false; }