protected function ProjectServiceContainer::getBarService

Gets the 'bar' service.

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

Return value

FooClass A FooClass instance.

File

drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9.php, line 54

Class

ProjectServiceContainer
ProjectServiceContainer

Code

protected function getBarService() {
  $this->services['bar'] = $instance = new \FooClass('foo', $this
    ->get('foo.baz'), $this
    ->getParameter('foo_bar'));
  $this
    ->get('foo.baz')
    ->configure($instance);
  return $instance;
}