@@ -11,8 +11,8 @@ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
11
11
interpreted as described in [ RFC 2119] [ ] .
12
12
13
13
The word ` implementor ` in this document is to be interpreted as someone
14
- implementing the ` ContainerInterface ` in a depency injection-related library or framework.
15
- Users of dependency injections containers (DIC) are refered to as ` user ` .
14
+ implementing the ` ContainerInterface ` in a dependency injection-related library or framework.
15
+ Users of dependency injections containers (DIC) are referred to as ` user ` .
16
16
17
17
[ RFC 2119 ] : http://tools.ietf.org/html/rfc2119
18
18
@@ -31,50 +31,50 @@ Users of dependency injections containers (DIC) are refered to as `user`.
31
31
` user ` SHOULD NOT rely on getting the same value on 2 successive calls.
32
32
While ` ContainerInterface ` only defines one mandatory parameter in ` get() ` , implementations
33
33
MAY accept additional optional parameters.
34
-
34
+
35
35
- ` has ` takes one unique parameter: an entry identifier. It MUST return ` true `
36
36
if an entry identifier is known to the container and ` false ` if it is not.
37
-
37
+
38
38
### 1.2 Exceptions
39
39
40
- Exceptions directly thrown by the container MUST implement the
40
+ Exceptions directly thrown by the container MUST implement the
41
41
[ ` Interop\Container\Exception\ContainerException ` ] ( ../src/Interop/Container/Exception/ContainerException.php ) .
42
42
43
43
A call to the ` get ` method with a non-existing id SHOULD throw a
44
44
[ ` Interop\Container\Exception\NotFoundException ` ] ( ../src/Interop/Container/Exception/NotFoundException.php ) .
45
45
46
46
### 1.3 Additional features
47
47
48
- This section describes additional features that MAY be added to a container. Containers are not
48
+ This section describes additional features that MAY be added to a container. Containers are not
49
49
required to implement these features to respect the ContainerInterface.
50
50
51
51
#### 1.3.1 Delegate lookup feature
52
52
53
- The goal of the * delegate lookup* feature is to allow several containers to share entries.
53
+ The goal of the * delegate lookup* feature is to allow several containers to share entries.
54
54
Containers implementing this feature can perform dependency lookups in other containers.
55
55
56
- Containers implementing this feature will offer a greater lever of interoperability
56
+ Containers implementing this feature will offer a greater lever of interoperability
57
57
with other containers. Implementation of this feature is therefore RECOMMENDED.
58
58
59
59
A container implementing this feature:
60
60
61
61
- MUST implement the ` ContainerInterface `
62
- - MUST provide a way to register a delegate container (using a constructor parameter, or a setter,
62
+ - MUST provide a way to register a delegate container (using a constructor parameter, or a setter,
63
63
or any possible way). The delegate container MUST implement the ` ContainerInterface ` .
64
64
65
65
When a container is configured to use a delegate container for dependencies:
66
66
67
- - Calls to the ` get ` method should only return an entry if the entry is part of the container.
68
- If the entry is not part of the container, an exception should be thrown
67
+ - Calls to the ` get ` method should only return an entry if the entry is part of the container.
68
+ If the entry is not part of the container, an exception should be thrown
69
69
(as requested by the ` ContainerInterface ` ).
70
70
- Calls to the ` has ` method should only return ` true ` if the entry is part of the container.
71
71
If the entry is not part of the container, ` false ` should be returned.
72
- - If the fetched entry has dependencies, ** instead** of performing
72
+ - If the fetched entry has dependencies, ** instead** of performing
73
73
the dependency lookup in the container, the lookup is performed on the * delegate container* .
74
74
75
75
Important! By default, the lookup SHOULD be performed on the delegate container ** only** , not on the container itself.
76
76
77
- It is however allowed for containers to provide exception cases for special entries, and a way to lookup
77
+ It is however allowed for containers to provide exception cases for special entries, and a way to lookup
78
78
into the same container (or another container) instead of the delegate container.
79
79
80
80
2 . Package
0 commit comments