@@ -91,16 +91,16 @@ directory using the `drupal.drupal_root` parameter.
91
91
92
92
```
93
93
parameters:
94
- drupal:
95
- drupal_root: /path/to/drupal
94
+ drupal:
95
+ drupal_root: /path/to/drupal
96
96
```
97
97
98
98
You can also use container parameters. For instance you can always set it to the current working directory.
99
99
100
100
```
101
101
parameters:
102
- drupal:
103
- drupal_root: %currentWorkingDirectory%
102
+ drupal:
103
+ drupal_root: %currentWorkingDirectory%
104
104
```
105
105
106
106
### Entity storage mappings.
@@ -111,23 +111,36 @@ default mapping can be found in `extension.neon`. For example:
111
111
112
112
```
113
113
parameters:
114
- drupal:
115
- entityTypeStorageMapping:
116
- node: Drupal\node\NodeStorage
117
- taxonomy_term: Drupal\taxonomy\TermStorage
118
- user: Drupal\user\UserStorage
119
- block: Drupal\Core\Config\Entity\ConfigEntityStorage
114
+ drupal:
115
+ entityTypeStorageMapping:
116
+ block:
117
+ class: Drupal\block\Entity\Block
118
+ storage: Drupal\Core\Config\Entity\ConfigEntityStorage
119
+ node:
120
+ class: Drupal\node\Entity\Node
121
+ storage: Drupal\node\NodeStorage
122
+ taxonomy_term:
123
+ class: Drupal\taxonomy\Entity\Term
124
+ storage: Drupal\taxonomy\TermStorage
125
+ user:
126
+ class: Drupal\user\Entity\User
127
+ storage: Drupal\user\UserStorage
120
128
```
121
129
122
130
To add support for custom entities, you may add the same definition in your project's ` phpstan.neon ` . See the following
123
131
example for adding a mapping for Search API:
124
132
125
133
```
126
134
parameters:
127
- drupal:
128
- entityTypeStorageMapping:
129
- search_api_index: Drupal\search_api\Entity\SearchApiConfigEntityStorage
130
- search_api_server: Drupal\search_api\Entity\SearchApiConfigEntityStorage
135
+ drupal:
136
+ entityTypeStorageMapping:
137
+ block:
138
+ search_api_index:
139
+ class: Drupal\search_api\Entity\Index
140
+ storage: Drupal\search_api\Entity\SearchApiConfigEntityStorage
141
+ search_api_server:
142
+ class: Drupal\search_api\Entity\Server
143
+ storage: Drupal\search_api\Entity\SearchApiConfigEntityStorage
131
144
```
132
145
133
146
Similarly, the ` EntityStorageDynamicReturnTypeExtension ` service helps to determine the type of the entity which is
@@ -145,11 +158,19 @@ The default mapping can be found in `extension.neon`:
145
158
``` neon
146
159
parameters:
147
160
drupal:
148
- entityStorageMapping:
149
- node: Drupal\node\Entity\Node
150
- taxonomy_term: Drupal\taxonomy\Entity\Term
151
- user: Drupal\user\Entity\User
152
- block: Drupal\block\Entity\Block
161
+ entityTypeStorageMapping:
162
+ block:
163
+ class: Drupal\block\Entity\Block
164
+ storage: Drupal\Core\Config\Entity\ConfigEntityStorage
165
+ node:
166
+ class: Drupal\node\Entity\Node
167
+ storage: Drupal\node\NodeStorage
168
+ taxonomy_term:
169
+ class: Drupal\taxonomy\Entity\Term
170
+ storage: Drupal\taxonomy\TermStorage
171
+ user:
172
+ class: Drupal\user\Entity\User
173
+ storage: Drupal\user\UserStorage
153
174
```
154
175
155
176
To add support for custom entities, you may add the same definition in your project's ` phpstan.neon ` likewise.
0 commit comments