annotate core/lib/Drupal/Core/DependencyInjection/ContainerInjectionInterface.php @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 4c8ae668cc8c
children
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 namespace Drupal\Core\DependencyInjection;
Chris@0 4
Chris@0 5 use Symfony\Component\DependencyInjection\ContainerInterface;
Chris@0 6
Chris@0 7 /**
Chris@0 8 * Defines a common interface for dependency container injection.
Chris@0 9 *
Chris@0 10 * This interface gives classes who need services a factory method for
Chris@0 11 * instantiation rather than defining a new service.
Chris@0 12 */
Chris@0 13 interface ContainerInjectionInterface {
Chris@0 14
Chris@0 15 /**
Chris@0 16 * Instantiates a new instance of this class.
Chris@0 17 *
Chris@0 18 * This is a factory method that returns a new instance of this class. The
Chris@0 19 * factory should pass any needed dependencies into the constructor of this
Chris@0 20 * class, but not the container itself. Every call to this method must return
Chris@0 21 * a new instance of this class; that is, it may not implement a singleton.
Chris@0 22 *
Chris@0 23 * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
Chris@0 24 * The service container this instance should use.
Chris@0 25 */
Chris@0 26 public static function create(ContainerInterface $container);
Chris@0 27
Chris@0 28 }