AddMissingMethodPhpDocRector
Executes AST inspections parsing missing documentation on methods automatically.
Description
It MUST append @param, @return, and @throws tags where deduced accurately.
The logic SHALL NOT override existing documentation.
Methods
Designates the primary Abstract Syntax Tree (AST) node structures intercepted.
Delivers the formal rule description configured within the Rector ecosystem.
Computes necessary PHPDoc metadata for a given class method selectively.
Expands Name syntax objects into human-readable string descriptors universally.
Parses the architectural scope of an intercepted method to infer exceptional operations natively.
Translates complicated type primitives cleanly back into uniform string declarations consistently.
Designates the primary Abstract Syntax Tree (AST) node structures intercepted.
public
getNodeTypes() : array<int, Node>>
Description
The method MUST register solely ClassMethod class references to guarantee precision.
Return values
Description
the structural bindings applicable for this modification
Delivers the formal rule description configured within the Rector ecosystem.
public
getRuleDefinition() : RuleDefinition
Description
The method MUST accurately describe its functional changes logically.
Return values
Description
explains the rule's active behavior context
Computes necessary PHPDoc metadata for a given class method selectively.
public
refactor(Node
$node) : Node
Description
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
$node
:
Node
Description
the target method representation parsed synchronously
Return values
Description
the refined active syntax instance inclusive of generated documentation
Expands Name syntax objects into human-readable string descriptors universally.
private
resolveNameToString(Name
$name) : string
Description
The method MUST handle aliases seamlessly or fallback to base names dependably.
Parameters
$name
:
Name
Description
the structured reference to parse accurately
Return values
Description
the computed class identifier successfully reconstructed
Parses the architectural scope of an intercepted method to infer exceptional operations natively.
private
resolveThrows(ClassMethod
$node) : array<string|int, string>
Description
This method MUST accurately deduce exception creations traversing internal components recursively. It SHALL strictly return precise, unique internal naming identifiers safely.
Parameters
$node
:
ClassMethod
Description
the active evaluated root target element dynamically instantiated
Return values
Description
expected failure objects effectively defined within its contextual boundary
Translates complicated type primitives cleanly back into uniform string declarations consistently.
private
resolveTypeToString(
string|Identifier|Name|ComplexType|null
$type) : string
Description
The method MUST parse complex combinations including Intersections, Unions natively and securely.
Parameters
$type
:
string|Identifier|Name|ComplexType|null
Description
the original metadata instance safely captured
Return values
Description
the final interpreted designation string explicitly represented safely