3 namespace Drupal\Core\DependencyInjection;
6 * Provides an interface to get a instance of a class with dependency injection.
8 interface ClassResolverInterface {
11 * Returns a class instance with a given class definition.
13 * In contrast to controllers you don't specify a method.
15 * @param string $definition
16 * A class name or service name.
19 * The instance of the class.
21 * @throws \InvalidArgumentException
22 * If $class is not a valid service identifier and the class does not exist.
24 public function getInstanceFromDefinition($definition);