Наследование: implements PhpSpec\ServiceContainer
Пример #1
0
 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']);
     }
 }
Пример #2
0
 /**
  * @param IndexedServiceContainer $container
  */
 private function setupShutdown(IndexedServiceContainer $container)
 {
     $container->define('process.shutdown', function () {
         return new Shutdown();
     });
 }
Пример #3
0
 /**
  * @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();
     });
 }