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
Install `dot-annotated-services` by running the following command in your project directory:
24
23
25
24
composer require dotkernel/dot-annotated-services
26
25
27
-
28
26
After installing, register `dot-annotated-services` in your project by adding the below line to your configuration aggregate (usually: `config/config.php`):
29
27
30
28
Dot\AnnotatedServices\ConfigProvider::class,
31
29
32
-
33
30
## Usage
34
31
35
32
### Using the AttributedServiceFactory
36
33
37
34
You can register services in the service manager using `AttributedServiceFactory` as seen in the below example:
Copy file name to clipboardExpand all lines: docs/book/v4/cache.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,6 @@
2
2
3
3
`dot-annotated-services` reads class annotations using [doctrine/annotations](https://github.com/doctrine/annotations) and caches them using [doctrine/cache](https://github.com/doctrine/cache).
4
4
5
-
6
5
## Configuration
7
6
8
7
In order to cache annotations, you should register a service factory at key `AbstractAnnotatedFactory::CACHE_SERVICE` that should return a valid `Doctrine\Common\Cache\Cache` cache driver.
@@ -19,7 +18,9 @@ You can add this configuration values to your application's Doctrine config file
19
18
],
20
19
];
21
20
```
21
+
22
22
where `AnnotationsCacheFactory` is a custom factory that needs to return a [Doctrine Cache Driver](https://github.com/doctrine/cache/tree/1.13.x/lib/Doctrine/Common/Cache):
Copy file name to clipboardExpand all lines: docs/book/v4/configuration.md
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,4 +3,3 @@
3
3
After installation, register `dot-annotated-services` in your project by adding the below line to your configuration aggregator (usually: `config/config.php`):
Copy file name to clipboardExpand all lines: docs/book/v4/usage.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,5 +3,6 @@
3
3
Version `4.x` of `dot-annotated-services` is the last version that uses [doctrine/annotations](https://github.com/doctrine/annotations) to parse and inject dependencies.
4
4
5
5
You can use it to:
6
+
6
7
-[Inject class dependencies](factories/service.md)
0 commit comments