private function registerCustomMatchers(IndexedServiceContainer $container, array $matchersClassnames) { foreach ($matchersClassnames as $class) { $this->ensureIsValidMatcherClass($class); $container->define(sprintf('matchers.%s', $class), function () use($class) { return new $class(); }, ['matchers']); } }
/** * @param IndexedServiceContainer $container */ private function setupShutdown(IndexedServiceContainer $container) { $container->define('process.shutdown', function () { return new Shutdown(); }); }
/** * @param IndexedServiceContainer $container */ private function assembleHtmlPresenter(IndexedServiceContainer $container) { $container->define('formatter.presenter.html', function (IndexedServiceContainer $c) { return new SimplePresenter($c->get('formatter.presenter.value_presenter'), new SimpleExceptionPresenter($c->get('formatter.presenter.differ'), $c->get('formatter.presenter.html.exception_element_presenter'), new CallArgumentsPresenter($c->get('formatter.presenter.differ')), $c->get('formatter.presenter.html.exception.phpspec'))); }); $container->define('formatter.presenter.html.exception_element_presenter', function (IndexedServiceContainer $c) { return new SimpleExceptionElementPresenter($c->get('formatter.presenter.value.exception_type_presenter'), $c->get('formatter.presenter.value_presenter')); }); $container->define('formatter.presenter.html.exception.phpspec', function () { return new HtmlPhpSpecExceptionPresenter(); }); }