You are here

protected function ProjectServiceContainer::getServiceFromAnonymousFactoryService in Service Container 7

Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services19.php \ProjectServiceContainer::getServiceFromAnonymousFactoryService()

Gets the 'service_from_anonymous_factory' service.

This service is shared. This method always returns the same instance of the service.

Return value

\Bar\FooClass A Bar\FooClass instance.

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services19.php, line 42

Class

ProjectServiceContainer
ProjectServiceContainer.

Code

protected function getServiceFromAnonymousFactoryService() {
  return $this->services['service_from_anonymous_factory'] = call_user_func(array(
    new \Bar\FooClass(),
    'getInstance',
  ));
}