matcher = $matcher; $this->check = $check; } protected function generateMatches( ComponentValueList $values, $start, array $options ) { foreach ( $this->matcher->generateMatches( $values, $start, $options ) as $match ) { if ( call_user_func( $this->check, $values, $match, $options ) ) { yield $this->makeMatch( $values, $start, $match->getNext(), $match ); } } } }