Conditions | 1 |
Paths | 1 |
Total Lines | 32 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | private function appendRepositories(ArrayNodeDefinition $root): ArrayNodeDefinition |
||
24 | { |
||
25 | $repositories = $root->children() |
||
26 | ->arrayNode('repositories') |
||
27 | ->prototype('array'); |
||
28 | |||
29 | assert($repositories instanceof ArrayNodeDefinition); |
||
30 | |||
31 | $repositories->children() |
||
32 | ->arrayNode('args') |
||
33 | ->isRequired() |
||
34 | ->prototype('variable'); |
||
35 | |||
36 | $repositories->children() |
||
37 | ->arrayNode('managers') |
||
38 | ->requiresAtLeastOneElement() |
||
39 | ->prototype('scalar') |
||
40 | ->defaultValue(['default']); |
||
41 | |||
42 | $repositories->children() |
||
43 | ->scalarNode('entity') |
||
44 | ->isRequired() |
||
45 | ->validate() |
||
46 | ->ifTrue( |
||
47 | function ($v) { |
||
48 | return !class_exists($v); |
||
49 | } |
||
50 | ) |
||
51 | ->thenInvalid('Entity class does not exist'); |
||
52 | |||
53 | return $root; |
||
54 | } |
||
55 | } |
||
56 |