Skip to content

Commit 7708dca

Browse files
add check symfony/cache is installed and improve doc
1 parent cc6995e commit 7708dca

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

docs/annotations/index.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
In order to use annotations or attributes, you need to configure the mapping:
44

5-
To use annotations, use the `annotation` mapping type.
5+
To use annotations, You must install `symfony/cache` and `doctrine/annotation` and use the `annotation` mapping type.
6+
7+
68
```yaml
79
# config/packages/graphql.yaml
810
overblog_graphql:
@@ -13,7 +15,7 @@ overblog_graphql:
1315
dir: "%kernel.project_dir%/src/GraphQL"
1416
suffix: ~
1517
```
16-
18+
To use annoation, you must instal ' '' ' and use the annatotton mapping type
1719
To use attributes, use the `attribute` mapping type.
1820

1921
```yaml

src/Config/Parser/AnnotationParser.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ protected static function getAnnotationReader(): Reader
4444
throw new RuntimeException("In order to use annotations, you need to install 'doctrine/annotations' first. See: 'https://www.doctrine-project.org/projects/annotations.html'");
4545
// @codeCoverageIgnoreEnd
4646
}
47+
if (!class_exists(ApcuAdapter::class)) {
48+
// @codeCoverageIgnoreStart
49+
throw new RuntimeException("In order to use annotations, you need to install 'symfony/cache' first. See: 'https://symfony.com/doc/current/components/cache.html'");
50+
// @codeCoverageIgnoreEnd
51+
}
52+
4753

4854
if (class_exists(AnnotationRegistry::class)) {
4955
AnnotationRegistry::registerLoader('class_exists');

0 commit comments

Comments
 (0)