Repository navigation
Expand file tree
/
Copy pathMutableContainer.php
More file actions
46 lines (39 loc) · 1.52 KB
/
Copy pathMutableContainer.php
File metadata and controls
46 lines (39 loc) · 1.52 KB
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
46
<?php declare(strict_types=1);
namespace Tribe\Libs\Container;
use Psr\Container\ContainerInterface;
interface MutableContainer {
/**
* Wrap an existing container and create a new instance of this container.
*
* Items in the wrapped container are still resolved in this container.
*
* @param \Psr\Container\ContainerInterface|null $container
*
* @return \Tribe\Libs\Container\MutableContainer|\DI\Container|ContainerInterface|\DI\FactoryInterface|\Invoker\InvokerInterface
*/
public function wrap( ?ContainerInterface $container = null );
/**
* Make a completely fresh object, including all of its dependencies.
*
* @template T
*
* @param class-string<T> $name Entry name or a class name.
* @param array $parameters Optional parameters to use to build the entry. Use this to force
* specific parameters to specific values. Parameters not defined in this
* array will be resolved using the container.
*
* @throws \DI\DependencyException
* @throws \DI\NotFoundException
* @throws \ReflectionException
*
* @return mixed|T
*/
public function makeFresh( string $name, array $parameters = [] );
/**
* Flush the container of all bindings and resolved instances in this
* container and the wrapped container.
*
* @return \Tribe\Libs\Container\MutableContainer|\DI\Container|ContainerInterface|\DI\FactoryInterface|\Invoker\InvokerInterface
*/
public function flush();
}