File tree Expand file tree Collapse file tree 1 file changed +0
-25
lines changed Expand file tree Collapse file tree 1 file changed +0
-25
lines changed Original file line number Diff line number Diff line change 44use PhpParser \Comment ;
55use PhpParser \Node ;
66use PhpParser \ParserFactory ;
7- use PHPStan \PhpDocParser \Ast \PhpDoc \PhpDocChildNode ;
87use PHPStan \PhpDocParser \Ast \PhpDoc \PhpDocNode ;
98use PHPStan \PhpDocParser \Ast \PhpDoc \PhpDocTagNode ;
109use PHPStan \PhpDocParser \Ast \PhpDoc \ReturnTagValueNode ;
@@ -594,30 +593,6 @@ private function compareFunctions(Node\FunctionLike $old, Node\FunctionLike $new
594593 }
595594 }
596595
597- if (
598- $ old ->getReturnType () !== null
599- && $ new ->getReturnType () !== null
600- && $ new ->getDocComment () !== null
601- ) {
602- if ($ old ->getDocComment () === null || $ this ->findPhpDocReturn ($ this ->parseDocComment ($ old ->getDocComment ()->getText ())) === null ) {
603- $ newPhpDocNode = $ this ->parseDocComment ($ new ->getDocComment ()->getText ());
604- if ($ this ->findPhpDocReturn ($ newPhpDocNode ) !== null ) {
605- $ newPhpDocNodeWithoutReturn = new PhpDocNode (array_values (array_filter ($ newPhpDocNode ->children , function (PhpDocChildNode $ child ): bool {
606- if (!$ child instanceof PhpDocTagNode) {
607- return true ;
608- }
609-
610- return !$ child ->value instanceof ReturnTagValueNode;
611- })));
612- if (count ($ newPhpDocNodeWithoutReturn ->children ) === 0 ) {
613- $ old ->setAttribute ('comments ' , []);
614- } else {
615- $ old ->setDocComment (new Comment \Doc ((string ) $ newPhpDocNodeWithoutReturn ));
616- }
617- }
618- }
619- }
620-
621596 $ oldPhpDocParameters = [];
622597 $ newPhpDocParameters = [];
623598 if ($ old ->getDocComment () !== null ) {
You can’t perform that action at this time.
0 commit comments