PhpSpec\Runner\Maintainer\MatchersMaintainer::prepare PHP Method

prepare() public method

public prepare ( ExampleNode $example, PhpSpec\Specification $context, MatcherManager $matchers, CollaboratorManager $collaborators )
$example PhpSpec\Loader\Node\ExampleNode
$context PhpSpec\Specification
$matchers PhpSpec\Runner\MatcherManager
$collaborators PhpSpec\Runner\CollaboratorManager
    public function prepare(ExampleNode $example, Specification $context, MatcherManager $matchers, CollaboratorManager $collaborators)
    {
        $matchers->replace($this->defaultMatchers);
        if (!$context instanceof MatchersProvider) {
            return;
        }
        foreach ($context->getMatchers() as $name => $matcher) {
            if ($matcher instanceof Matcher) {
                $matchers->add($matcher);
            } else {
                $matchers->add(new CallbackMatcher($name, $matcher, $this->presenter));
            }
        }
    }