Skip to content

AddMissingMethodPhpDocRector

github-actions edited this page Mar 25, 2026 · 2 revisions

Executes AST inspections parsing missing documentation on methods automatically.

It MUST append @param, @return, and @throws tags where deduced accurately. The logic SHALL NOT override existing documentation.


  • Full name: \FastForward\DevTools\Rector\AddMissingMethodPhpDocRector
  • Parent class: AbstractRector
  • This class is marked as final and can't be subclassed
  • This class is a Final class

Methods

getRuleDefinition

Delivers the formal rule description configured within the Rector ecosystem.

public getRuleDefinition(): \Symplify\RuleDocGenerator\ValueObject\RuleDefinition

The method MUST accurately describe its functional changes logically.

Return Value:

explains the rule's active behavior context


getNodeTypes

Designates the primary Abstract Syntax Tree (AST) node structures intercepted.

public getNodeTypes(): array<int,class-string<\PhpParser\Node>>

The method MUST register solely ClassMethod class references to guarantee precision.

Return Value:

the structural bindings applicable for this modification


refactor

Computes necessary PHPDoc metadata for a given class method selectively.

public refactor(\PhpParser\Node $node): \PhpParser\Node

The method MUST identify the missing @param, @return, and @throws tags algorithmically. It SHALL preserve pre-existing valid tags cleanly. If no augmentation is achieved, it returns the node unaltered.

Parameters:

Parameter Type Description
$node \PhpParser\Node the target method representation parsed synchronously

Return Value:

the refined active syntax instance inclusive of generated documentation


Clone this wiki locally