You are here

protected function ProjectServiceContainer::getServiceWithMethodCallAndFactoryService in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dependency-injection/Tests/Fixtures/php/services19.php \ProjectServiceContainer::getServiceWithMethodCallAndFactoryService()

Gets the 'service_with_method_call_and_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

vendor/symfony/dependency-injection/Tests/Fixtures/php/services19.php, line 55

Class

ProjectServiceContainer
ProjectServiceContainer.

Code

protected function getServiceWithMethodCallAndFactoryService() {
  $this->services['service_with_method_call_and_factory'] = $instance = new \Bar\FooClass();
  $instance
    ->setBar(\Bar\FooClass::getInstance());
  return $instance;
}