Thruway\Role\Broker::addMatcher PHP Method

addMatcher() public method

public addMatcher ( Thruway\Subscription\MatcherInterface $matcher ) : boolean
$matcher Thruway\Subscription\MatcherInterface
return boolean
    public function addMatcher(MatcherInterface $matcher)
    {
        foreach ($matcher->getMatchTypes() as $matchType) {
            if (isset($this->matchers[$matchType])) {
                return false;
            }
        }
        foreach ($matcher->getMatchTypes() as $matchType) {
            $this->matchers[$matchType] = $matcher;
        }
        return true;
    }