|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace Assimtech\DislogBundle\DependencyInjection; |
|
6
|
|
|
|
|
7
|
|
|
use Symfony\Component\Config\Definition\Builder\TreeBuilder; |
|
8
|
|
|
use Symfony\Component\Config\Definition\ConfigurationInterface; |
|
9
|
|
|
|
|
10
|
|
|
class Configuration implements ConfigurationInterface |
|
11
|
|
|
{ |
|
12
|
|
|
public function getConfigTreeBuilder(): TreeBuilder |
|
13
|
5 |
|
{ |
|
14
|
|
|
$treeBuilder = new TreeBuilder('assimtech_dislog'); |
|
15
|
5 |
|
$rootNode = method_exists(TreeBuilder::class, 'getRootNode') |
|
16
|
5 |
|
? $treeBuilder->getRootNode() |
|
17
|
|
|
: $treeBuilder->root('assimtech_dislog') |
|
|
|
|
|
|
18
|
|
|
; |
|
19
|
5 |
|
|
|
20
|
5 |
|
$rootNode |
|
21
|
5 |
|
->children() |
|
22
|
5 |
|
->scalarNode('api_call_factory') |
|
23
|
5 |
|
->defaultValue('assimtech_dislog.api_call.factory') |
|
24
|
5 |
|
->end() |
|
25
|
5 |
|
->arrayNode('handler') |
|
26
|
|
|
->isRequired() |
|
27
|
5 |
|
->children() |
|
28
|
5 |
|
// stream options |
|
29
|
5 |
|
->arrayNode('stream') |
|
30
|
5 |
|
->children() |
|
31
|
5 |
|
->scalarNode('resource') |
|
32
|
5 |
|
->isRequired() |
|
33
|
5 |
|
->end() |
|
34
|
5 |
|
->scalarNode('identity_generator') |
|
35
|
5 |
|
->defaultValue('assimtech_dislog.generator.unique_id') |
|
36
|
5 |
|
->end() |
|
37
|
5 |
|
->scalarNode('serializer') |
|
38
|
5 |
|
->defaultValue('assimtech_dislog.serializer.string') |
|
39
|
5 |
|
->end() |
|
40
|
|
|
->end() |
|
41
|
|
|
->end() |
|
42
|
5 |
|
|
|
43
|
5 |
|
// doctrine_document_manager options |
|
44
|
5 |
|
->arrayNode('doctrine_document_manager') |
|
45
|
5 |
|
->children() |
|
46
|
5 |
|
->scalarNode('document_manager') |
|
47
|
5 |
|
->isRequired() |
|
48
|
5 |
|
->end() |
|
49
|
|
|
->end() |
|
50
|
|
|
->end() |
|
51
|
5 |
|
|
|
52
|
5 |
|
// doctrine_entity_manager options |
|
53
|
5 |
|
->arrayNode('doctrine_entity_manager') |
|
54
|
5 |
|
->children() |
|
55
|
5 |
|
->scalarNode('entity_manager') |
|
56
|
5 |
|
->isRequired() |
|
57
|
5 |
|
->end() |
|
58
|
5 |
|
->end() |
|
59
|
5 |
|
->end() |
|
60
|
|
|
|
|
61
|
4 |
|
// doctrine_object_manager options |
|
62
|
5 |
|
->arrayNode('doctrine_object_manager') |
|
63
|
5 |
|
->children() |
|
64
|
5 |
|
->scalarNode('object_manager') |
|
65
|
5 |
|
->isRequired() |
|
66
|
5 |
|
->end() |
|
67
|
5 |
|
->end() |
|
68
|
5 |
|
->end() |
|
69
|
5 |
|
|
|
70
|
5 |
|
// service options |
|
71
|
5 |
|
->arrayNode('service') |
|
72
|
5 |
|
->children() |
|
73
|
5 |
|
->scalarNode('name') |
|
74
|
5 |
|
->isRequired() |
|
75
|
5 |
|
->end() |
|
76
|
5 |
|
->end() |
|
77
|
5 |
|
->end() |
|
78
|
|
|
->end() |
|
79
|
|
|
->validate() |
|
80
|
5 |
|
->ifTrue(function ($v) { |
|
81
|
|
|
return count($v) !== 1; |
|
82
|
|
|
}) |
|
83
|
|
|
->thenInvalid('A single handler section must be configured') |
|
84
|
|
|
->end() |
|
85
|
|
|
->end() |
|
86
|
|
|
->integerNode('max_age') |
|
87
|
|
|
->defaultValue(60 * 60 * 24 * 30) // 30 days |
|
88
|
|
|
->end() |
|
89
|
|
|
->arrayNode('preferences') |
|
90
|
|
|
->addDefaultsIfNotSet() |
|
91
|
|
|
->children() |
|
92
|
|
|
->booleanNode('suppress_handler_exceptions') |
|
93
|
|
|
->defaultTrue() |
|
94
|
|
|
->end() |
|
95
|
|
|
->end() |
|
96
|
|
|
->end() |
|
97
|
|
|
->scalarNode('psr_logger') |
|
98
|
|
|
->defaultValue('logger') |
|
99
|
|
|
->end() |
|
100
|
|
|
->end() |
|
101
|
|
|
; |
|
102
|
|
|
|
|
103
|
|
|
return $treeBuilder; |
|
104
|
|
|
} |
|
105
|
|
|
} |
|
106
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.