summaryrefslogtreecommitdiff
path: root/vendor/symfony/service-contracts/ServiceSubscriberInterface.php
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2024-08-13 23:45:21 +0200
committerpolo <ordipolo@gmx.fr>2024-08-13 23:45:21 +0200
commitbf6655a534a6775d30cafa67bd801276bda1d98d (patch)
treec6381e3f6c81c33eab72508f410b165ba05f7e9c /vendor/symfony/service-contracts/ServiceSubscriberInterface.php
parent94d67a4b51f8e62e7d518cce26a526ae1ec48278 (diff)
downloadAppliGestionPHP-bf6655a534a6775d30cafa67bd801276bda1d98d.zip
VERSION 0.2 doctrine ORM et entités
Diffstat (limited to 'vendor/symfony/service-contracts/ServiceSubscriberInterface.php')
-rw-r--r--vendor/symfony/service-contracts/ServiceSubscriberInterface.php62
1 files changed, 62 insertions, 0 deletions
diff --git a/vendor/symfony/service-contracts/ServiceSubscriberInterface.php b/vendor/symfony/service-contracts/ServiceSubscriberInterface.php
new file mode 100644
index 0000000..3da1916
--- /dev/null
+++ b/vendor/symfony/service-contracts/ServiceSubscriberInterface.php
@@ -0,0 +1,62 @@
1<?php
2
3/*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12namespace Symfony\Contracts\Service;
13
14use Symfony\Contracts\Service\Attribute\SubscribedService;
15
16/**
17 * A ServiceSubscriber exposes its dependencies via the static {@link getSubscribedServices} method.
18 *
19 * The getSubscribedServices method returns an array of service types required by such instances,
20 * optionally keyed by the service names used internally. Service types that start with an interrogation
21 * mark "?" are optional, while the other ones are mandatory service dependencies.
22 *
23 * The injected service locators SHOULD NOT allow access to any other services not specified by the method.
24 *
25 * It is expected that ServiceSubscriber instances consume PSR-11-based service locators internally.
26 * This interface does not dictate any injection method for these service locators, although constructor
27 * injection is recommended.
28 *
29 * @author Nicolas Grekas <p@tchwork.com>
30 */
31interface ServiceSubscriberInterface
32{
33 /**
34 * Returns an array of service types (or {@see SubscribedService} objects) required
35 * by such instances, optionally keyed by the service names used internally.
36 *
37 * For mandatory dependencies:
38 *
39 * * ['logger' => 'Psr\Log\LoggerInterface'] means the objects use the "logger" name
40 * internally to fetch a service which must implement Psr\Log\LoggerInterface.
41 * * ['loggers' => 'Psr\Log\LoggerInterface[]'] means the objects use the "loggers" name
42 * internally to fetch an iterable of Psr\Log\LoggerInterface instances.
43 * * ['Psr\Log\LoggerInterface'] is a shortcut for
44 * * ['Psr\Log\LoggerInterface' => 'Psr\Log\LoggerInterface']
45 *
46 * otherwise:
47 *
48 * * ['logger' => '?Psr\Log\LoggerInterface'] denotes an optional dependency
49 * * ['loggers' => '?Psr\Log\LoggerInterface[]'] denotes an optional iterable dependency
50 * * ['?Psr\Log\LoggerInterface'] is a shortcut for
51 * * ['Psr\Log\LoggerInterface' => '?Psr\Log\LoggerInterface']
52 *
53 * additionally, an array of {@see SubscribedService}'s can be returned:
54 *
55 * * [new SubscribedService('logger', Psr\Log\LoggerInterface::class)]
56 * * [new SubscribedService(type: Psr\Log\LoggerInterface::class, nullable: true)]
57 * * [new SubscribedService('http_client', HttpClientInterface::class, attributes: new Target('githubApi'))]
58 *
59 * @return string[]|SubscribedService[] The required service types, optionally keyed by service names
60 */
61 public static function getSubscribedServices(): array;
62}