trait AutowireTrait (View source)

A copy of \Drupal\Core\DependencyInjection\AutowireTrait with first params' type hint changed.

Defines a trait for automatically wiring dependencies from the container.

This trait uses reflection and may cause performance issues with classes that will be instantiated multiple times.

Methods

static AutowireTrait
create(ContainerInterface $container)

Instantiates a new instance of the implementing class using autowiring.

Details

static AutowireTrait create(ContainerInterface $container)

Instantiates a new instance of the implementing class using autowiring.

Parameters

ContainerInterface $container

The service container this instance should use.

Return Value

AutowireTrait