1818use Twig \Extension \CoreExtension ;
1919use Twig \Loader \LoaderInterface ;
2020use Twig \Node \Expression \ArrayExpression ;
21- use Twig \Node \Expression \ConditionalExpression ;
2221use Twig \Node \Expression \ConstantExpression ;
2322use Twig \Node \Expression \Ternary \ConditionalTernary ;
2423use Twig \Node \Expression \Variable \ContextVariable ;
@@ -207,27 +206,15 @@ public function testCompileLabelWithLabelAndAttributes()
207206
208207 public function testCompileLabelWithLabelThatEvaluatesToNull ()
209208 {
210- if (class_exists (ConditionalTernary::class)) {
211- $ conditional = new ConditionalTernary (
212- // if
213- new ConstantExpression (true , 0 ),
214- // then
215- new ConstantExpression (null , 0 ),
216- // else
217- new ConstantExpression (null , 0 ),
218- 0
219- );
220- } else {
221- $ conditional = new ConditionalExpression (
222- // if
223- new ConstantExpression (true , 0 ),
224- // then
225- new ConstantExpression (null , 0 ),
226- // else
227- new ConstantExpression (null , 0 ),
228- 0
229- );
230- }
209+ $ conditional = new ConditionalTernary (
210+ // if
211+ new ConstantExpression (true , 0 ),
212+ // then
213+ new ConstantExpression (null , 0 ),
214+ // else
215+ new ConstantExpression (null , 0 ),
216+ 0
217+ );
231218
232219 $ arguments = new Nodes ([new ContextVariable ('form ' , 0 ), $ conditional ]);
233220
@@ -250,27 +237,15 @@ public function testCompileLabelWithLabelThatEvaluatesToNull()
250237
251238 public function testCompileLabelWithLabelThatEvaluatesToNullAndAttributes ()
252239 {
253- if (class_exists (ConditionalTernary::class)) {
254- $ conditional = new ConditionalTernary (
255- // if
256- new ConstantExpression (true , 0 ),
257- // then
258- new ConstantExpression (null , 0 ),
259- // else
260- new ConstantExpression (null , 0 ),
261- 0
262- );
263- } else {
264- $ conditional = new ConditionalExpression (
265- // if
266- new ConstantExpression (true , 0 ),
267- // then
268- new ConstantExpression (null , 0 ),
269- // else
270- new ConstantExpression (null , 0 ),
271- 0
272- );
273- }
240+ $ conditional = new ConditionalTernary (
241+ // if
242+ new ConstantExpression (true , 0 ),
243+ // then
244+ new ConstantExpression (null , 0 ),
245+ // else
246+ new ConstantExpression (null , 0 ),
247+ 0
248+ );
274249
275250 $ arguments = new Nodes ([
276251 new ContextVariable ('form ' , 0 ),
0 commit comments