annotate vendor/symfony/dependency-injection/ServiceSubscriberInterface.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents a9cd425dd02b
children
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 /*
Chris@0 4 * This file is part of the Symfony package.
Chris@0 5 *
Chris@0 6 * (c) Fabien Potencier <fabien@symfony.com>
Chris@0 7 *
Chris@0 8 * For the full copyright and license information, please view the LICENSE
Chris@0 9 * file that was distributed with this source code.
Chris@0 10 */
Chris@0 11
Chris@0 12 namespace Symfony\Component\DependencyInjection;
Chris@0 13
Chris@0 14 /**
Chris@0 15 * A ServiceSubscriber exposes its dependencies via the static {@link getSubscribedServices} method.
Chris@0 16 *
Chris@0 17 * The getSubscribedServices method returns an array of service types required by such instances,
Chris@0 18 * optionally keyed by the service names used internally. Service types that start with an interrogation
Chris@0 19 * mark "?" are optional, while the other ones are mandatory service dependencies.
Chris@0 20 *
Chris@0 21 * The injected service locators SHOULD NOT allow access to any other services not specified by the method.
Chris@0 22 *
Chris@0 23 * It is expected that ServiceSubscriber instances consume PSR-11-based service locators internally.
Chris@0 24 * This interface does not dictate any injection method for these service locators, although constructor
Chris@0 25 * injection is recommended.
Chris@0 26 *
Chris@0 27 * @author Nicolas Grekas <p@tchwork.com>
Chris@0 28 */
Chris@0 29 interface ServiceSubscriberInterface
Chris@0 30 {
Chris@0 31 /**
Chris@0 32 * Returns an array of service types required by such instances, optionally keyed by the service names used internally.
Chris@0 33 *
Chris@0 34 * For mandatory dependencies:
Chris@0 35 *
Chris@4 36 * * ['logger' => 'Psr\Log\LoggerInterface'] means the objects use the "logger" name
Chris@0 37 * internally to fetch a service which must implement Psr\Log\LoggerInterface.
Chris@4 38 * * ['Psr\Log\LoggerInterface'] is a shortcut for
Chris@4 39 * * ['Psr\Log\LoggerInterface' => 'Psr\Log\LoggerInterface']
Chris@0 40 *
Chris@0 41 * otherwise:
Chris@0 42 *
Chris@4 43 * * ['logger' => '?Psr\Log\LoggerInterface'] denotes an optional dependency
Chris@4 44 * * ['?Psr\Log\LoggerInterface'] is a shortcut for
Chris@4 45 * * ['Psr\Log\LoggerInterface' => '?Psr\Log\LoggerInterface']
Chris@0 46 *
Chris@0 47 * @return array The required service types, optionally keyed by service names
Chris@0 48 */
Chris@0 49 public static function getSubscribedServices();
Chris@0 50 }