rector/templates/custom-rule/utils/rector/src/Rector/__Name__.php
Tomas Votruba 120a7594fb Updated Rector to commit b2d76bd6eff80326b8f89a061f44b06cf90ba49a
b2d76bd6ef Improve config builder + add withAttributesSets() method (#5509)
2024-01-27 12:22:01 +00:00

51 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
namespace Utils\Rector\Rector;
use PhpParser\Node;
use Rector\Rector\AbstractRector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
* @see \Utils\Rector\Tests\Rector\__Name__\__Name__Test
*/
final class __Name__ extends AbstractRector
{
public function getRuleDefinition(): RuleDefinition
{
return new RuleDefinition('// @todo fill the description', [
new CodeSample(
<<<'CODE_SAMPLE'
// @todo fill code before
CODE_SAMPLE
,
<<<'CODE_SAMPLE'
// @todo fill code after
CODE_SAMPLE
),
]);
}
/**
* @return array<class-string<Node>>
*/
public function getNodeTypes(): array
{
// @todo select node type
return [\PhpParser\Node\Stmt\Class_::class];
}
/**
* @param \PhpParser\Node\Stmt\Class_ $node
*/
public function refactor(Node $node): ?Node
{
// @todo change the node
return $node;
}
}