AddMissingClassPhpDocRector
Provides automated refactoring to prepend basic PHPDoc comments on classes missing them.
Description
This rule MUST adhere to AST standards and SHALL traverse Class_ nodes exclusively.
Methods
Declares the types of Abstract Syntax Tree nodes that trigger this refactoring run.
Resolves the definition describing this rule for documentation generation.
Triggers the modification process against a matched AST node.
Declares the types of Abstract Syntax Tree nodes that trigger this refactoring run.
public
getNodeTypes() : array<int, Node>>
Description
The method MUST identify Class_ nodes reliably. It SHALL define the interception target.
Return values
Description
an array containing registered node class references
Resolves the definition describing this rule for documentation generation.
public
getRuleDefinition() : RuleDefinition
Description
The method MUST return a properly instantiated RuleDefinition stating its purpose.
Return values
Description
the description entity for the given Rector rule
Triggers the modification process against a matched AST node.
public
refactor(Node
$node) : Node|null
Description
The method MUST verify the absence of an existing PHPDoc header accurately. It SHOULD append a basic boilerplate PHPDoc comment if applicable. If the node is unchanged, it SHALL return null.
Parameters
$node
:
Node
Description
the current active syntax instance parsed by the framework
Return values
Description
the modified active syntax state, or null if untouched