Conditions | 1 |
Paths | 1 |
Total Lines | 49 |
Code Lines | 41 |
Lines | 0 |
Ratio | 0 % |
Tests | 43 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
39 | 2 | public function getConfigTreeBuilder() |
|
40 | 1 | { |
|
41 | 2 | $treeBuilder = new TreeBuilder(); |
|
42 | 2 | $rootNode = $treeBuilder->root($this->alias); |
|
43 | 2 | $rootNode->children() |
|
44 | 2 | ->scalarNode('serializer') |
|
45 | 2 | ->cannotBeEmpty() |
|
46 | 2 | ->isRequired() |
|
47 | 2 | ->validate() |
|
48 | 2 | ->ifTrue(function($v) { |
|
49 | 2 | return strpos($v, '@') !== 0; |
|
50 | 2 | }) |
|
51 | 2 | ->thenInvalid('Serializer has to be in form "@service.id"') |
|
52 | 2 | ->end() |
|
53 | 2 | ->end() |
|
54 | 2 | ->arrayNode('drivers') |
|
55 | 2 | ->prototype('array') |
|
56 | 2 | ->children() |
|
57 | 2 | ->scalarNode('rabbitmq_connection') |
|
58 | 2 | ->cannotBeEmpty() |
|
59 | 2 | ->isRequired() |
|
60 | 2 | ->end() |
|
61 | 2 | ->scalarNode('exchange_name') |
|
62 | 2 | ->cannotBeEmpty() |
|
63 | 2 | ->isRequired() |
|
64 | 2 | ->end() |
|
65 | 2 | ->scalarNode('consumer_name') |
|
66 | 2 | ->cannotBeEmpty() |
|
67 | 2 | ->isRequired() |
|
68 | 2 | ->end() |
|
69 | 2 | ->scalarNode('consumer_queue_name') |
|
70 | 2 | ->cannotBeEmpty() |
|
71 | 2 | ->isRequired() |
|
72 | 2 | ->end() |
|
73 | 2 | ->scalarNode('producer_name') |
|
74 | 2 | ->cannotBeEmpty() |
|
75 | 2 | ->isRequired() |
|
76 | 2 | ->end() |
|
77 | 2 | ->end() |
|
78 | 2 | ->end() |
|
79 | 2 | ->end() |
|
80 | 2 | ->end(); |
|
81 | |||
82 | // Here you should define the parameters that are allowed to |
||
83 | // configure your bundle. See the documentation linked above for |
||
84 | // more information on that topic. |
||
85 | |||
86 | 2 | return $treeBuilder; |
|
87 | } |
||
88 | } |
||
89 |