-
Notifications
You must be signed in to change notification settings - Fork 10
/
ServiceProviderInterface.php
45 lines (41 loc) · 1.62 KB
/
ServiceProviderInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
namespace Interop\Container;
use Psr\Container\ContainerInterface;
/**
* A service provider provides entries to a container.
*/
interface ServiceProviderInterface
{
/**
* Returns a list of all container entries registered by this service provider.
*
* - the key is the entry name
* - the value is a callable that will return the entry, aka the **factory**
*
* A factory is an instance of {@see FactoryDefinitionInterface}, or a `callable` with the following signature:
*
* function(\Psr\Container\ContainerInterface $container)
*
* @return array<string,((callable(ContainerInterface):mixed)|FactoryDefinitionInterface)>
*/
public function getFactories(): array;
/**
* Returns a list of all container entries extended by this service provider.
*
* - the key is the entry name
* - the value is a callable that will return the modified entry
*
* An extension is an instance of {@see ExtensionDefinitionInterface}, or a `callable` with the following signature:
*
* function(Psr\Container\ContainerInterface $container, $previous)
* or function(Psr\Container\ContainerInterface $container, $previous = null)
*
* About factories parameters:
*
* - the container (instance of `Psr\Container\ContainerInterface`)
* - the entry to be extended. If the entry to be extended does not exist and the parameter is nullable, `null` will be passed.
*
* @return array<string,((callable(ContainerInterface,mixed):mixed)|ExtensionDefinitionInterface)[]>
*/
public function getExtensions(): array;
}