You are here

protected function ProjectServiceContainer::getNewFactoryService in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/dependency-injection/Tests/Fixtures/php/services9.php \ProjectServiceContainer::getNewFactoryService()

Gets the 'new_factory' service.

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

This service is private. If you want to be able to request this service from the container directly, make it public, otherwise you might end up with broken code.

Return value

\FactoryClass A FactoryClass instance.

File

vendor/symfony/dependency-injection/Tests/Fixtures/php/services9.php, line 354

Class

ProjectServiceContainer
ProjectServiceContainer.

Code

protected function getNewFactoryService() {
  $this->services['new_factory'] = $instance = new \FactoryClass();
  $instance->foo = 'bar';
  return $instance;
}