pQuery\DomNode::match PHP Метод

match() публичный Метод

Checks if node matches certain conditions
public match ( $conditions, array $match = true, array $custom_filters = [] ) : boolean
$match array Should conditions evaluate to true?
$custom_filters array Custom map next to {@link $filter_map}
Результат boolean
    function match($conditions, $match = true, $custom_filters = array())
    {
        $t = isset($conditions['tags']);
        $a = isset($conditions['attributes']);
        $f = isset($conditions['filters']);
        if (!($t || $a || $f)) {
            if (is_array($conditions) && $conditions) {
                foreach ($conditions as $c) {
                    if ($this->match($c, $match)) {
                        return true;
                    }
                }
            }
            return false;
        } else {
            if (($t && !$this->match_tags($conditions['tags'])) === $match) {
                return false;
            }
            if (($a && !$this->match_attributes($conditions['attributes'])) === $match) {
                return false;
            }
            if (($f && !$this->match_filters($conditions['filters'], $custom_filters)) === $match) {
                return false;
            }
            return true;
        }
    }
DomNode