You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Added the ability to inject a collection of services as an array or a custom collection by passing an implementation of `Cspray\AnnotatedContainer\ContainerFactory\ListOf` to an `#[Inject]` attribute.
13
+
- Added `Cspray\AnnotatedContainer\ContainerFactory\ListOfAsArray` implementation of to allow implementing a collection of services as an array out-of-the-box
14
+
15
+
### Deprecated
16
+
17
+
Several portions of the library will now trigger deprecation notices. These notices are to indicate you're using a feature that will be removed in 3.0. Each message will explain what feature is being used and what it is being replaced with. Some deprecations can be replaced now while others do not have suitable replacements until 3.0 is launched.
18
+
19
+
#### Observer Removal Deprecations
20
+
21
+
In v3 the bootstrapping Observer system is being replaced with a more complete Event system that encompasses the entire Annotated Container lifecycle. The deprecations in this section are related to the removal of this system. There is no suitable replacement until v3 hits for these deprecations. However, transitioning to the new Event system mostly involves implementing a new interface and adjusting a method signature. Your implementations should not require adjustments.
22
+
23
+
- Providing a `Cspray\AnnotatedContainer\Bootstrap\ObserverFactory` during your bootstrapping process will trigger a deprecation.
24
+
- Calling `Cspray\AnnotatedContainer\Bootstrap::addObserver` during your bootstrapping process will trigger a deprecation.
25
+
- Extending and using the `Cspray\AnnotatedContainer\Bootstrap\ServiceWiringObserver` will trigger a deprecation.
26
+
- Providing any observers in your `annotated-container.xml` file will trigger a deprecation.
27
+
28
+
#### Transition `ActiveProfiles` to `Profiles`
29
+
30
+
In v3 the `Cspray\AnnotatedContainer\Profiles` module has been removed and drastically simplified. In v2.x this module was overly complicated and not designed properly for usability in mind. This led to funky code dealing with these complications and a subpar user experience. The entire module was replaced by a single value object and a set of static constructors. There is no suitable replacement until v3 hits for these deprecations.
31
+
32
+
- Calling `Cspray\AnnotatedContainer\Profiles\ActiveProfiles::getProfiles` or `ActiveProfiles::isActive` will trigger a deprecation.
33
+
- Using the `Cspray\AnnotatedContainer\Profiles\ActiveProfilesBuilder` will trigger a deprecation.
34
+
- Calling `Cspray\AnnotatedContainer\Profiles\CsvActiveProfilesParser` will trigger a deprecation.
35
+
36
+
#### Removing Logging
37
+
38
+
In v3 Logging has been moved to a separate library that has to be explicitly opted in via the new Event system. Making this a separate, explicit opt-in that you must configure greatly simplifies the bootstrapping process and reduces the amount of code in Annotated Container.
39
+
40
+
- Defining a `<logging></logging>` configuration in `annoatated-container.xml` will trigger a deprecation.
41
+
42
+
#### Removing Configuration Attribute
43
+
44
+
The #[Configuration] Attribute has long been deprecated. It was not well-thought-out and the sole reason the ability to inject into properties existed. It has long been recommended to move to using the #[Service] Attribute directly or implementing your own custom attribute.
45
+
46
+
- Defining an instance of `Cspray\AnnotatedContainer\Attribute\ConfigurationAttribute` will trigger a deprecation.
47
+
48
+
#### Removing `cacheDir` configuration
49
+
50
+
In v3 caching functionality is drastically improved and much more control is provided over how your ContainerDefinition is cached. This new caching system must be setup as part of your bootstrapping and can't be configured.
51
+
52
+
- Defining a `<cacheDir></cacheDir>` configuration in `annotated-container.xml` will trigger a deprecation.
Copy file name to clipboardExpand all lines: src/Bootstrap/XmlBootstrappingConfiguration.php
+7
Original file line number
Diff line number
Diff line change
@@ -173,6 +173,13 @@ public function __construct(
173
173
$cache = $cacheDirNodes[0]->textContent;
174
174
}
175
175
176
+
if ($cache !== null) {
177
+
trigger_error(
178
+
'A cache directory is defined in your configuration. The ability to define a cache through configuration is removed in v3 and must setup as part of your bootstrapping code.',
0 commit comments