1
0
mirror of https://github.com/rectorphp/rector.git synced 2025-03-15 04:49:44 +01:00
Tomas Votruba 82e31fbd26 Updated Rector to commit d21dcc3ce357fade02860ae611a6d1baf7dcc975
d21dcc3ce3 [Renaming] Fully Qualified import doc same name renaming class error ()
2021-09-28 05:01:55 +00:00

35 lines
1.7 KiB
PHP

<?php
declare (strict_types=1);
namespace Rector\BetterPhpDocParser\PhpDocNodeVisitor;
use PHPStan\PhpDocParser\Ast\Node;
use PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode;
use Rector\BetterPhpDocParser\Attributes\AttributeMirrorer;
use Rector\BetterPhpDocParser\Contract\BasePhpDocNodeVisitorInterface;
use Rector\BetterPhpDocParser\ValueObject\PhpDoc\VariadicAwareParamTagValueNode;
use RectorPrefix20210928\Symplify\SimplePhpDocParser\PhpDocNodeVisitor\AbstractPhpDocNodeVisitor;
final class ParamPhpDocNodeVisitor extends \RectorPrefix20210928\Symplify\SimplePhpDocParser\PhpDocNodeVisitor\AbstractPhpDocNodeVisitor implements \Rector\BetterPhpDocParser\Contract\BasePhpDocNodeVisitorInterface
{
/**
* @var \Rector\BetterPhpDocParser\Attributes\AttributeMirrorer
*/
private $attributeMirrorer;
public function __construct(\Rector\BetterPhpDocParser\Attributes\AttributeMirrorer $attributeMirrorer)
{
$this->attributeMirrorer = $attributeMirrorer;
}
public function enterNode(\PHPStan\PhpDocParser\Ast\Node $node) : ?\PHPStan\PhpDocParser\Ast\Node
{
if (!$node instanceof \PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode) {
return null;
}
if ($node instanceof \Rector\BetterPhpDocParser\ValueObject\PhpDoc\VariadicAwareParamTagValueNode) {
return null;
}
$variadicAwareParamTagValueNode = new \Rector\BetterPhpDocParser\ValueObject\PhpDoc\VariadicAwareParamTagValueNode($node->type, $node->isVariadic, $node->parameterName, $node->description);
$this->attributeMirrorer->mirror($node, $variadicAwareParamTagValueNode);
return $variadicAwareParamTagValueNode;
}
}