You are here

protected function ProjectServiceContainer::getDependsOnRequestService 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/services20.php \ProjectServiceContainer::getDependsOnRequestService()

Gets the 'depends_on_request' service.

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

Return value

\stdClass A stdClass instance.

File

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

Class

ProjectServiceContainer
ProjectServiceContainer.

Code

protected function getDependsOnRequestService() {
  $this->services['depends_on_request'] = $instance = new \stdClass();
  $instance
    ->setRequest($this
    ->get('request', ContainerInterface::NULL_ON_INVALID_REFERENCE));
  return $instance;
}