1111
1212namespace Symfony \Component \VarDumper \Tests \Caster ;
1313
14+ use PHPUnit \Framework \Attributes \RequiresPhp ;
1415use PHPUnit \Framework \TestCase ;
1516use Symfony \Component \VarDumper \Test \VarDumperTestTrait ;
1617
@@ -32,9 +33,7 @@ public function testCastImplementation()
3233 );
3334 }
3435
35- /**
36- * @requires PHP 8.4
37- */
36+ #[RequiresPhp('8.4 ' )]
3837 public function testCastModernImplementation ()
3938 {
4039 $ implementation = new \Dom \Implementation ();
@@ -49,9 +48,7 @@ public function testCastModernImplementation()
4948 );
5049 }
5150
52- /**
53- * @requires PHP < 8.4
54- */
51+ #[RequiresPhp('<8.4 ' )]
5552 public function testCastNodePriorToPhp84 ()
5653 {
5754 $ doc = new \DOMDocument ();
@@ -70,9 +67,7 @@ public function testCastNodePriorToPhp84()
7067 );
7168 }
7269
73- /**
74- * @requires PHP 8.4
75- */
70+ #[RequiresPhp('8.4 ' )]
7671 public function testCastNode ()
7772 {
7873 $ doc = new \DOMDocument ();
@@ -91,9 +86,7 @@ public function testCastNode()
9186 );
9287 }
9388
94- /**
95- * @requires PHP 8.4
96- */
89+ #[RequiresPhp('8.4 ' )]
9790 public function testCastModernNode ()
9891 {
9992 $ doc = \Dom \XMLDocument::createFromString ('<foo><bar/></foo> ' );
@@ -129,9 +122,7 @@ public function testCastDocument()
129122 );
130123 }
131124
132- /**
133- * @requires PHP 8.4
134- */
125+ #[RequiresPhp('8.4 ' )]
135126 public function testCastXMLDocument ()
136127 {
137128 $ doc = \Dom \XMLDocument::createFromString ('<foo><bar/></foo> ' );
@@ -150,9 +141,7 @@ public function testCastXMLDocument()
150141 );
151142 }
152143
153- /**
154- * @requires PHP 8.4
155- */
144+ #[RequiresPhp('8.4 ' )]
156145 public function testCastHTMLDocument ()
157146 {
158147 $ doc = \Dom \HTMLDocument::createFromString ('<!DOCTYPE html><html><body><p>foo</p></body></html> ' );
@@ -166,9 +155,7 @@ public function testCastHTMLDocument()
166155 );
167156 }
168157
169- /**
170- * @requires PHP < 8.4
171- */
158+ #[RequiresPhp('<8.4 ' )]
172159 public function testCastTextPriorToPhp84 ()
173160 {
174161 $ doc = new \DOMText ('foo ' );
@@ -182,9 +169,7 @@ public function testCastTextPriorToPhp84()
182169 );
183170 }
184171
185- /**
186- * @requires PHP 8.4
187- */
172+ #[RequiresPhp('8.4 ' )]
188173 public function testCastText ()
189174 {
190175 $ doc = new \DOMText ('foo ' );
@@ -198,9 +183,7 @@ public function testCastText()
198183 );
199184 }
200185
201- /**
202- * @requires PHP 8.4
203- */
186+ #[RequiresPhp('8.4 ' )]
204187 public function testCastModernText ()
205188 {
206189 $ text = \Dom \HTMLDocument::createEmpty ()->createTextNode ('foo ' );
@@ -213,9 +196,7 @@ public function testCastModernText()
213196 );
214197 }
215198
216- /**
217- * @requires PHP < 8.4
218- */
199+ #[RequiresPhp('<8.4 ' )]
219200 public function testCastAttrPriorToPhp84 ()
220201 {
221202 $ attr = new \DOMAttr ('attr ' , 'value ' );
@@ -233,9 +214,7 @@ public function testCastAttrPriorToPhp84()
233214 );
234215 }
235216
236- /**
237- * @requires PHP 8.4
238- */
217+ #[RequiresPhp('8.4 ' )]
239218 public function testCastAttr ()
240219 {
241220 $ attr = new \DOMAttr ('attr ' , 'value ' );
@@ -253,9 +232,7 @@ public function testCastAttr()
253232 );
254233 }
255234
256- /**
257- * @requires PHP 8.4
258- */
235+ #[RequiresPhp('8.4 ' )]
259236 public function testCastAttrPrior ()
260237 {
261238 $ attr = new \DOMAttr ('attr ' , 'value ' );
@@ -273,9 +250,7 @@ public function testCastAttrPrior()
273250 );
274251 }
275252
276- /**
277- * @requires PHP 8.4
278- */
253+ #[RequiresPhp('8.4 ' )]
279254 public function testCastModernAttr ()
280255 {
281256 $ attr = \Dom \HTMLDocument::createEmpty ()->createAttribute ('attr ' );
@@ -292,9 +267,7 @@ public function testCastModernAttr()
292267 );
293268 }
294269
295- /**
296- * @requires PHP < 8.4
297- */
270+ #[RequiresPhp('<8.4 ' )]
298271 public function testCastElementPriorToPhp84 ()
299272 {
300273 $ attr = new \DOMElement ('foo ' );
@@ -308,9 +281,7 @@ public function testCastElementPriorToPhp84()
308281 );
309282 }
310283
311- /**
312- * @requires PHP 8.4
313- */
284+ #[RequiresPhp('8.4 ' )]
314285 public function testCastElement ()
315286 {
316287 $ attr = new \DOMElement ('foo ' );
@@ -324,9 +295,7 @@ public function testCastElement()
324295 );
325296 }
326297
327- /**
328- * @requires PHP 8.4
329- */
298+ #[RequiresPhp('8.4 ' )]
330299 public function testCastModernElement ()
331300 {
332301 $ attr = \Dom \HTMLDocument::createEmpty ()->createElement ('foo ' );
@@ -340,9 +309,7 @@ public function testCastModernElement()
340309 );
341310 }
342311
343- /**
344- * @requires PHP < 8.4
345- */
312+ #[RequiresPhp('<8.4 ' )]
346313 public function testCastDocumentTypePriorToPhp84 ()
347314 {
348315 $ implementation = new \DOMImplementation ();
@@ -362,9 +329,7 @@ public function testCastDocumentTypePriorToPhp84()
362329 );
363330 }
364331
365- /**
366- * @requires PHP 8.4
367- */
332+ #[RequiresPhp('8.4 ' )]
368333 public function testCastDocumentType ()
369334 {
370335 $ implementation = new \DOMImplementation ();
@@ -384,9 +349,7 @@ public function testCastDocumentType()
384349 );
385350 }
386351
387- /**
388- * @requires PHP 8.4
389- */
352+ #[RequiresPhp('8.4 ' )]
390353 public function testCastModernDocumentType ()
391354 {
392355 $ implementation = new \Dom \Implementation ();
@@ -406,9 +369,7 @@ public function testCastModernDocumentType()
406369 );
407370 }
408371
409- /**
410- * @requires PHP < 8.4
411- */
372+ #[RequiresPhp('<8.4 ' )]
412373 public function testCastProcessingInstructionPriorToPhp84 ()
413374 {
414375 $ entity = new \DOMProcessingInstruction ('target ' , 'data ' );
@@ -423,9 +384,7 @@ public function testCastProcessingInstructionPriorToPhp84()
423384 );
424385 }
425386
426- /**
427- * @requires PHP 8.4
428- */
387+ #[RequiresPhp('8.4 ' )]
429388 public function testCastProcessingInstruction ()
430389 {
431390 $ entity = new \DOMProcessingInstruction ('target ' , 'data ' );
@@ -440,9 +399,7 @@ public function testCastProcessingInstruction()
440399 );
441400 }
442401
443- /**
444- * @requires PHP 8.4
445- */
402+ #[RequiresPhp('8.4 ' )]
446403 public function testCastModernProcessingInstruction ()
447404 {
448405 $ entity = \Dom \HTMLDocument::createEmpty ()->createProcessingInstruction ('target ' , 'data ' );
@@ -458,9 +415,7 @@ public function testCastModernProcessingInstruction()
458415 );
459416 }
460417
461- /**
462- * @requires PHP < 8.4
463- */
418+ #[RequiresPhp('<8.4 ' )]
464419 public function testCastXPathPriorToPhp84 ()
465420 {
466421 $ xpath = new \DOMXPath (new \DOMDocument ());
@@ -475,9 +430,7 @@ public function testCastXPathPriorToPhp84()
475430 );
476431 }
477432
478- /**
479- * @requires PHP 8.4
480- */
433+ #[RequiresPhp('8.4 ' )]
481434 public function testCastXPath ()
482435 {
483436 $ xpath = new \DOMXPath (new \DOMDocument ());
@@ -492,9 +445,7 @@ public function testCastXPath()
492445 );
493446 }
494447
495- /**
496- * @requires PHP 8.4
497- */
448+ #[RequiresPhp('8.4 ' )]
498449 public function testCastModernXPath ()
499450 {
500451 $ entity = new \Dom \XPath (\Dom \HTMLDocument::createEmpty ());
0 commit comments