@@ -144,6 +144,50 @@ public static function getContainerDefinitions()
144
144
];
145
145
}
146
146
147
+ public static function getContainerBuildersWithPriorityTags ()
148
+ {
149
+ $ builder = new ContainerBuilder ();
150
+ $ builder ->setDefinitions (self ::getContainerDefinitionsWithPriorityTags ());
151
+
152
+ return ['builder ' => $ builder ];
153
+ }
154
+
155
+ public static function getContainerDefinitionsWithPriorityTags ()
156
+ {
157
+ $ definition1 = new Definition ('Full \\Qualified \\Class1 ' );
158
+ $ definition2 = new Definition ('Full \\Qualified \\Class2 ' );
159
+ $ definition3 = new Definition ('Full \\Qualified \\Class3 ' );
160
+
161
+ return [
162
+ 'definition_1 ' => $ definition1
163
+ ->setPublic (true )
164
+ ->setSynthetic (true )
165
+ ->setFile ('/path/to/file ' )
166
+ ->setLazy (false )
167
+ ->setAbstract (false )
168
+ ->addTag ('tag1 ' , ['attr1 ' => 'val1 ' , 'priority ' => 30 ])
169
+ ->addTag ('tag1 ' , ['attr2 ' => 'val2 ' ])
170
+ ->addTag ('tag2 ' )
171
+ ->addMethodCall ('setMailer ' , [new Reference ('mailer ' )])
172
+ ->setFactory ([new Reference ('factory.service ' ), 'get ' ]),
173
+ 'definition_2 ' => $ definition2
174
+ ->setPublic (true )
175
+ ->setSynthetic (true )
176
+ ->setFile ('/path/to/file ' )
177
+ ->setLazy (false )
178
+ ->setAbstract (false )
179
+ ->addTag ('tag1 ' , ['attr1 ' => 'val1 ' , 'attr2 ' => 'val2 ' , 'priority ' => -20 ]),
180
+ 'definition_3 ' => $ definition3
181
+ ->setPublic (true )
182
+ ->setSynthetic (true )
183
+ ->setFile ('/path/to/file ' )
184
+ ->setLazy (false )
185
+ ->setAbstract (false )
186
+ ->addTag ('tag1 ' , ['attr1 ' => 'val1 ' , 'attr2 ' => 'val2 ' , 'priority ' => 0 ])
187
+ ->addTag ('tag1 ' , ['attr3 ' => 'val3 ' , 'priority ' => 40 ]),
188
+ ];
189
+ }
190
+
147
191
public static function getContainerAliases ()
148
192
{
149
193
return [
0 commit comments