public function ExampleClassWithDependencyInjection::test2 in Coder 8.3.x
Same name and namespace in other branches
- 8.3 tests/DrupalPractice/Objects/drupal8/ExampleClassWithDependencyInjection.php \Drupal\testmodule\ExampleClassWithDependencyInjection::test2()
Loading nodes directly is not allowed, we should use an injected service.
File
- tests/
DrupalPractice/ Objects/ drupal8/ ExampleClassWithDependencyInjection.php, line 23
Class
- ExampleClassWithDependencyInjection
- A class which is not a service but has access to the container.
Namespace
Drupal\testmoduleCode
public function test2() {
return Node::load(1);
}