[FEATURE] Add symfony dependency injection for core and extbase
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / DependencyInjection / ServiceProviderInterface.php
1 <?php
2 namespace TYPO3\CMS\Core\DependencyInjection;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 /**
18 * A service provider provides entries to a container. Inspired by:
19 * https://github.com/container-interop/service-provider/blob/v0.4.0/src/ServiceProviderInterface.php
20 * @internal
21 */
22 interface ServiceProviderInterface
23 {
24 /**
25 * Returns a list of all container entries registered by this service provider.
26 *
27 * - the key is the entry name
28 * - the value is a callable that will return the entry, aka the **factory**
29 *
30 * Factories have the following signature:
31 * function(\Psr\Container\ContainerInterface $container)
32 *
33 * @return callable[]
34 */
35 public function getFactories();
36
37 /**
38 * Returns a list of all container entries extended by this service provider.
39 *
40 * - the key is the entry name
41 * - the value is a callable that will return the modified entry
42 *
43 * Callables have the following signature:
44 * function(Psr\Container\ContainerInterface $container, $previous)
45 * or function(Psr\Container\ContainerInterface $container, $previous = null)
46 *
47 * About factories parameters:
48 *
49 * - the container (instance of `Psr\Container\ContainerInterface`)
50 * - the entry to be extended. If the entry to be extended does not exist and the parameter is nullable, `null` will be passed.
51 *
52 * @return callable[]
53 */
54 public function getExtensions();
55 }