function TestClassWithSetter::setService
Same name and namespace in other branches
- main core/tests/Drupal/Tests/Core/DependencyInjection/AutowiredInstanceTraitTest.php \Drupal\Tests\Core\DependencyInjection\TestClassWithSetter::setService()
Attributes
#[Required]
File
-
core/
tests/ Drupal/ Tests/ Core/ DependencyInjection/ AutowiredInstanceTraitTest.php, line 52
Class
- TestClassWithSetter
- Test class with a setter method for dependency injection.
Namespace
Drupal\Tests\Core\DependencyInjectionCode
public function setService(#[Autowire(service: 'my_service')] $service) : void {
$this->injectedService = $service;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.