function Selector::exec
Executes the current selector on the given matches
Parameters
Return value
File
-
vendor/
mck89/ peast/ lib/ Peast/ Selector/ Node/ Selector.php, line 48
Class
- Selector
- Selector class
Namespace
Peast\Selector\NodeCode
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];
}