function ServiceWithDependency::__construct
Same name in other branches
- 9 core/modules/system/tests/modules/new_dependency_test/src/ServiceWithDependency.php \Drupal\new_dependency_test\ServiceWithDependency::__construct()
- 8.9.x core/modules/system/tests/modules/new_dependency_test/src/ServiceWithDependency.php \Drupal\new_dependency_test\ServiceWithDependency::__construct()
- 11.x core/modules/system/tests/modules/new_dependency_test/src/ServiceWithDependency.php \Drupal\new_dependency_test\ServiceWithDependency::__construct()
ServiceWithDependency constructor.
Parameters
\Drupal\new_dependency_test\InjectedService|null $service: The service of the same module which has the new dependency.
File
-
core/
modules/ system/ tests/ modules/ new_dependency_test/ src/ ServiceWithDependency.php, line 25
Class
- ServiceWithDependency
- Service that gets the other service of the same module injected.
Namespace
Drupal\new_dependency_testCode
public function __construct(?InjectedService $service = NULL) {
$this->service = $service;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.