Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PseudoSelector.php

function PseudoSelector::check

Returns true if the selector part matches the given node, false otherwise

Parameters

Node $node Node:

Node $parent Parent node:

Return value

bool

Overrides Part::check

File

vendor/mck89/peast/lib/Peast/Selector/Node/Part/PseudoSelector.php, line 59

Class

PseudoSelector
Selector part selector pseudo class

Namespace

Peast\Selector\Node\Part

Code

public function check(Node $node, $parent = null) {
    $match = new Matches();
    $match->addMatch($node, $parent);
    $res = $this->selector
        ->exec($match)
        ->count();
    return $this->name === "not" ? $res === 0 : $res !== 0;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal