src/PHPHtmlParser/Selector/Selector.php
protected function checkKey(array $rule, AbstractNode $node): bool
    {
        if ($rule['noKey']) {
            if ( ! is_null($node->getAttribute($rule['key']))) {
                return false;
            }
        } else {
            if ($rule['key'] != 'plaintext' && !$node->hasAttribute($rule['key'])) {
                return false;
            }
        }

        return true;
    }
protected function checkKey(array $rule, AbstractNode $node): bool
    {
        if ($rule['noKey']) {
            if ( ! is_null($node->getAttribute($rule['key']))) {
                return false;
            }
        } else {
            if ($rule['key'] != 'plaintext' && !$node->hasAttribute($rule['key'])) {
                return false;
            }
        }

        return true;
    }
protected function checkKey ( array $ rule , AbstractNode $ node ) : bool { if ( $ rule [ 'noKey' ] ) { if ( ! is_null ( $ node -> getAttribute ( $ rule [ 'key' ] ) ) ) { return false ; } } else { if ( $ rule [ 'key' ] != 'plaintext' && ! $ node -> hasAttribute ( $ rule [ 'key' ] ) ) { return false ; } } return true ; }
Checks key condition from rules against node.

@param array $rule
@param AbstractNode $node
@return bool
Checks key condition from rules against node .