Skip to content

Commit

Permalink
[Performance] Only map comment to php_doc_info for Stmt and Param on …
Browse files Browse the repository at this point in the history
…BetterStandardPrinter (#4250)

* [Performance] Only map comment to php_doc_info for Stmt and Param on BetterStandardPrinter

* [ci-review] Rector Rectify

---------

Co-authored-by: GitHub Action <actions@github.com>
  • Loading branch information
samsonasik and actions-user committed Jun 17, 2023
1 parent 1d26219 commit 6282607
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/PhpParser/Printer/BetterStandardPrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Rector\Core\PhpParser\Printer;

use PhpParser\Node\Stmt;
use Nette\Utils\Strings;
use PhpParser\Comment;
use PhpParser\Node;
Expand Down Expand Up @@ -541,7 +542,7 @@ private function moveCommentsFromAttributeObjectToCommentsAttribute(array $nodes
{
// move phpdoc from node to "comment" attribute
foreach ($nodes as $node) {
if (! $node instanceof Node) {
if (! $node instanceof Stmt && ! $node instanceof Param) {
continue;
}

Expand Down

0 comments on commit 6282607

Please sign in to comment.