Mercurial > hg > isophonics-drupal-site
annotate core/lib/Drupal/Core/DependencyInjection/ContainerInjectionInterface.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
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 } |