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

Breadcrumb

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

function Selector::exec

Executes the current selector on the given matches

Parameters

Matches $matches Matches:

Return value

Matches

File

vendor/mck89/peast/lib/Peast/Selector/Node/Selector.php, line 48

Class

Selector
Selector class

Namespace

Peast\Selector\Node

Code

public function exec(Matches $matches) {
    $retMatches = array();
    foreach ($this->groups as $group) {
        $clonedMatches = $matches->createClone();
        $group->exec($clonedMatches);
        $retMatches[] = $clonedMatches;
    }
    if (count($retMatches) > 1) {
        $retMatches[0]->merge(array_slice($retMatches, 1));
    }
    return $retMatches[0];
}

API Navigation

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