@@ -36,6 +36,9 @@ public function getConfigTreeBuilder()
3636 ->append ($ this ->addSessionSupportSection ())
3737 ->append ($ this ->addDoctrineSection ())
3838 ->append ($ this ->addRouterSection ())
39+ ->append ($ this ->addAnnotationSection ())
40+ ->append ($ this ->addSerializerSection ())
41+ ->append ($ this ->addValidationSection ())
3942 ->append ($ this ->addLoggingSection ())
4043 ->end ();
4144
@@ -53,11 +56,9 @@ private function addSessionSupportSection()
5356 $ node = $ tree ->root ('session ' );
5457
5558 $ node
59+ ->canBeEnabled ()
5660 ->addDefaultsIfNotSet ()
5761 ->children ()
58- ->booleanNode ('enabled ' )
59- ->defaultFalse ()
60- ->end ()
6162 ->scalarNode ('service_id ' )->isRequired ()->end ()
6263 ->scalarNode ('prefix ' )
6364 ->defaultValue ('session_ ' )
@@ -68,6 +69,69 @@ private function addSessionSupportSection()
6869 return $ node ;
6970 }
7071
72+ /**
73+ * Configure the "cache.serializer" section.
74+ *
75+ * @return ArrayNodeDefinition
76+ */
77+ private function addSerializerSection ()
78+ {
79+ $ tree = new TreeBuilder ();
80+ $ node = $ tree ->root ('serializer ' );
81+
82+ $ node
83+ ->canBeEnabled ()
84+ ->addDefaultsIfNotSet ()
85+ ->children ()
86+ ->scalarNode ('service_id ' )->isRequired ()->end ()
87+ ->booleanNode ('use_tagging ' )->defaultTrue ()->end ()
88+ ->end ();
89+
90+ return $ node ;
91+ }
92+
93+ /**
94+ * Configure the "cache.serializer" section.
95+ *
96+ * @return ArrayNodeDefinition
97+ */
98+ private function addValidationSection ()
99+ {
100+ $ tree = new TreeBuilder ();
101+ $ node = $ tree ->root ('validation ' );
102+
103+ $ node
104+ ->canBeEnabled ()
105+ ->addDefaultsIfNotSet ()
106+ ->children ()
107+ ->scalarNode ('service_id ' )->isRequired ()->end ()
108+ ->booleanNode ('use_tagging ' )->defaultTrue ()->end ()
109+ ->end ();
110+
111+ return $ node ;
112+ }
113+
114+ /**
115+ * Configure the "cache.annotation" section.
116+ *
117+ * @return ArrayNodeDefinition
118+ */
119+ private function addAnnotationSection ()
120+ {
121+ $ tree = new TreeBuilder ();
122+ $ node = $ tree ->root ('annotation ' );
123+
124+ $ node
125+ ->canBeEnabled ()
126+ ->addDefaultsIfNotSet ()
127+ ->children ()
128+ ->scalarNode ('service_id ' )->isRequired ()->end ()
129+ ->booleanNode ('use_tagging ' )->defaultTrue ()->end ()
130+ ->end ();
131+
132+ return $ node ;
133+ }
134+
71135 /**
72136 * @return ArrayNodeDefinition
73137 */
@@ -77,11 +141,9 @@ private function addLoggingSection()
77141 $ node = $ tree ->root ('logging ' );
78142
79143 $ node
144+ ->canBeEnabled ()
80145 ->addDefaultsIfNotSet ()
81146 ->children ()
82- ->booleanNode ('enabled ' )
83- ->defaultFalse ()
84- ->end ()
85147 ->scalarNode ('logger ' )->defaultValue ('logger ' )->end ()
86148 ->scalarNode ('level ' )->defaultValue ('info ' )->end ()
87149 ->end ();
@@ -100,12 +162,9 @@ private function addDoctrineSection()
100162 $ node = $ tree ->root ('doctrine ' );
101163
102164 $ node
165+ ->canBeEnabled ()
103166 ->addDefaultsIfNotSet ()
104167 ->children ()
105- ->booleanNode ('enabled ' )
106- ->defaultFalse ()
107- ->isRequired ()
108- ->end ()
109168 ->booleanNode ('use_tagging ' )
110169 ->defaultTrue ()
111170 ->end ()
@@ -159,11 +218,10 @@ private function addRouterSection()
159218 $ tree = new TreeBuilder ();
160219 $ node = $ tree ->root ('router ' );
161220
162- $ node ->addDefaultsIfNotSet ()
221+ $ node
222+ ->canBeEnabled ()
223+ ->addDefaultsIfNotSet ()
163224 ->children ()
164- ->booleanNode ('enabled ' )
165- ->defaultFalse ()
166- ->end ()
167225 ->integerNode ('ttl ' )
168226 ->defaultValue (604800 )
169227 ->end ()
0 commit comments