@@ -551,6 +551,53 @@ private function compareFunctions(Node\FunctionLike $old, Node\FunctionLike $new
551
551
if (count ($ old ->getParams ()) !== count ($ new ->getParams ())) {
552
552
return $ this ->stmtDiff ($ old , $ new , $ updateTo );
553
553
}
554
+ $ oldAttribGroups = $ old ->getAttrGroups ();
555
+ $ oldAttribs = [];
556
+ foreach ($ oldAttribGroups as $ group ) {
557
+ foreach ($ group ->attrs as $ attrib ) {
558
+ if ($ attrib ->name ->toLowerString () !== 'since ' && $ attrib ->name ->toLowerString () !== 'until ' ) {
559
+ $ oldAttribs [] = $ attrib ;
560
+ }
561
+ }
562
+ }
563
+ $ newAttribGroups = $ new ->getAttrGroups ();
564
+ $ newAttribs = [];
565
+ foreach ($ newAttribGroups as $ group ) {
566
+ foreach ($ group ->attrs as $ attrib ) {
567
+ if ($ attrib ->name ->toLowerString () !== 'since ' && $ attrib ->name ->toLowerString () !== 'until ' ) {
568
+ $ newAttribs [] = $ attrib ;
569
+ }
570
+ }
571
+ }
572
+ if (count ($ oldAttribs ) !== count ($ newAttribs )) {
573
+ return $ this ->stmtDiff ($ old , $ new , $ updateTo );
574
+ }
575
+ foreach ($ oldAttribs as $ idx => $ oldAttrib ) {
576
+ $ newAttrib = $ newAttribs [$ idx ];
577
+ if ($ oldAttrib ->name ->name !== $ newAttrib ->name ->name ) {
578
+ return $ this ->stmtDiff ($ old , $ new , $ updateTo );
579
+ }
580
+ $ oldArgs = $ oldAttrib ->args ;
581
+ $ newArgs = $ newAttrib ->args ;
582
+ if (count ($ oldArgs ) !== count ($ newArgs )) {
583
+ return $ this ->stmtDiff ($ old , $ new , $ updateTo );
584
+ }
585
+ foreach ($ oldArgs as $ argIdx => $ oldArg ) {
586
+ $ newArg = $ newArgs [$ argIdx ];
587
+ if ($ oldArg ->name !== null && $ newArg ->name !== null ) {
588
+ if ($ oldArg ->name ->name !== $ newArg ->name ->name ) {
589
+ return $ this ->stmtDiff ($ old , $ new , $ updateTo );
590
+ }
591
+ } elseif ($ oldArg ->name !== null || $ newArg ->name !== null ) {
592
+ return $ this ->stmtDiff ($ old , $ new , $ updateTo );
593
+ }
594
+ $ oldArgValue = $ this ->printer ->prettyPrintExpr ($ oldArg ->value );
595
+ $ newArgValue = $ this ->printer ->prettyPrintExpr ($ newArg ->value );
596
+ if ($ oldArgValue !== $ newArgValue ) {
597
+ return $ this ->stmtDiff ($ old , $ new , $ updateTo );
598
+ }
599
+ }
600
+ }
554
601
555
602
foreach ($ old ->getParams () as $ i => $ oldParam ) {
556
603
$ newParam = $ new ->getParams ()[$ i ];
0 commit comments