class Service

Same name and namespace in other branches
  1. 9 core/modules/system/tests/modules/new_dependency_test/src/Service.php \Drupal\new_dependency_test\Service
  2. 10 core/modules/system/tests/modules/new_dependency_test/src/Service.php \Drupal\new_dependency_test\Service
  3. 11.x core/modules/system/tests/modules/new_dependency_test/src/Service.php \Drupal\new_dependency_test\Service

A service that can decorated itself.

Hierarchy

  • class \Drupal\new_dependency_test\Service

Expanded class hierarchy of Service

See also

new_dependency_test.services.yml

9 string references to 'Service'
BackendCompilerPassTest::getMysqlContainer in core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php
Creates a container with a mysql database service definition in it.
BackendCompilerPassTest::getSqliteContainer in core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php
Creates a container with a sqlite database service in it.
BackendCompilerPassTest::providerTestProcess in core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php
Provides test data for testProcess().
BackendCompilerPassTest::testProcess in core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php
Tests the process method.
Container::resolveServicesAndParameters in core/lib/Drupal/Component/DependencyInjection/Container.php
Resolves arguments that represent services or variables to the real values.

... See full list

4 services use Service
new_dependency_test.another_service in core/modules/system/tests/modules/new_dependency_test/new_dependency_test.services.yml
Drupal\new_dependency_test\Service
new_dependency_test.another_service.decorated in core/modules/system/tests/modules/new_dependency_test/new_dependency_test.services.yml
Drupal\new_dependency_test\Service
new_dependency_test.another_service_two in core/modules/system/tests/modules/new_dependency_test/new_dependency_test.services.yml
Drupal\new_dependency_test\Service
new_dependency_test.another_service_two.decorated in core/modules/system/tests/modules/new_dependency_test/new_dependency_test.services.yml
Drupal\new_dependency_test\Service

File

core/modules/system/tests/modules/new_dependency_test/src/Service.php, line 10

Namespace

Drupal\new_dependency_test
View source
class Service {
    
    /**
     * The decorated service.
     *
     * @var \Drupal\new_dependency_test\Service
     */
    protected $inner;
    
    /**
     * Service constructor.
     *
     * @param \Drupal\new_dependency_test\Service|null $inner
     *   The service to decorate.
     */
    public function __construct(Service $inner = NULL) {
        $this->inner = $inner;
    }
    
    /**
     * Determines if the service is decorated.
     *
     * @return bool
     *   TRUE if the services is decorated, FALSE if not.
     */
    public function isDecorated() {
        return isset($this->inner);
    }

}

Members

Title Sort descending Modifiers Object type Summary
Service::$inner protected property The decorated service.
Service::isDecorated public function Determines if the service is decorated.
Service::__construct public function Service constructor.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.