@@ -5949,6 +5949,67 @@ public function testLinesAndIndexes(string $phpDoc, array $childrenLines): void
59495949		}
59505950	}
59515951
5952+ 
5953+ 	/** 
5954+ 	 * @return iterable<array{string, list<array{int, int, int, int}>}> 
5955+ 	 */ 
5956+ 	public  function  dataDeepNodesLinesAndIndexes (): iterable 
5957+ 	{
5958+ 		yield  [
5959+ 			'/** '  . PHP_EOL  .
5960+ 			' * @X({ '  . PHP_EOL  .
5961+ 			' *     1, '  . PHP_EOL  .
5962+ 			' *     2 '  . PHP_EOL  .
5963+ 			' *    ,     '  . PHP_EOL  .
5964+ 			' *     3, '  . PHP_EOL  .
5965+ 			' * } '  . PHP_EOL  .
5966+ 			' * ) '  . PHP_EOL  .
5967+ 			' */ ' ,
5968+ 			[
5969+ 				[1 , 9 , 0 , 25 ], // PhpDocNode 
5970+ 				[2 , 8 , 2 , 23 ], // PhpDocTagNode 
5971+ 				[2 , 8 , 3 , 23 ], // DoctrineTagValueNode 
5972+ 				[2 , 8 , 3 , 23 ], // DoctrineAnnotation 
5973+ 				[2 , 8 , 4 , 22 ], // DoctrineArgument 
5974+ 				[2 , 8 , 4 , 22 ], // DoctrineArray 
5975+ 				[3 , 3 , 7 , 7 ], // DoctrineArrayItem 
5976+ 				[3 , 3 , 7 , 7 ], // ConstExprIntegerNode 
5977+ 				[4 , 5 , 11 , 12 ], // DoctrineArrayItem 
5978+ 				[4 , 5 , 11 , 12 ], // ConstExprIntegerNode 
5979+ 				[6 , 6 , 18 , 18 ], // DoctrineArrayItem 
5980+ 				[6 , 6 , 18 , 18 ], // ConstExprIntegerNode 
5981+ 			],
5982+ 		];
5983+ 	}
5984+ 
5985+ 
5986+ 	/** 
5987+ 	 * @dataProvider dataDeepNodesLinesAndIndexes 
5988+ 	 * @param list<array{int, int, int, int}> $nodeAttributes 
5989+ 	 */ 
5990+ 	public  function  testDeepNodesLinesAndIndexes (string  $ phpDocarray  $ nodeAttributesvoid 
5991+ 	{
5992+ 		$ tokensnew  TokenIterator ($ this lexer ->tokenize ($ phpDoc
5993+ 		$ usedAttributes
5994+ 			'lines '  => true ,
5995+ 			'indexes '  => true ,
5996+ 		];
5997+ 		$ constExprParsernew  ConstExprParser (true , true , $ usedAttributes
5998+ 		$ typeParsernew  TypeParser ($ constExprParsertrue , $ usedAttributes
5999+ 		$ phpDocParsernew  PhpDocParser ($ typeParser$ constExprParsertrue , true , $ usedAttributestrue );
6000+ 		$ visitornew  NodeCollectingVisitor ();
6001+ 		$ traversernew  NodeTraverser ([$ visitor
6002+ 		$ traversertraverse ([$ phpDocParserparse ($ tokens
6003+ 		$ nodes$ visitornodes ;
6004+ 		$ this assertCount (count ($ nodeAttributes$ nodes
6005+ 		foreach  ($ nodesas  $ i$ node
6006+ 			$ this assertSame ($ nodeAttributes$ i0 ], $ nodegetAttribute (Attribute::START_LINE ), sprintf ('Start line of %d. node ' , $ i1 ));
6007+ 			$ this assertSame ($ nodeAttributes$ i1 ], $ nodegetAttribute (Attribute::END_LINE ), sprintf ('End line of %d. node ' , $ i1 ));
6008+ 			$ this assertSame ($ nodeAttributes$ i2 ], $ nodegetAttribute (Attribute::START_INDEX ), sprintf ('Start index of %d. node ' , $ i1 ));
6009+ 			$ this assertSame ($ nodeAttributes$ i3 ], $ nodegetAttribute (Attribute::END_INDEX ), sprintf ('End index of %d. node ' , $ i1 ));
6010+ 		}
6011+ 	}
6012+ 
59526013	/** 
59536014	 * @return array<mixed> 
59546015	 */ 
0 commit comments