StubFunctionParser
class StubFunctionParser implements MultiEntityStubParserInterface (View source)
Parses PHP function nodes from AST into PHPFunction domain objects.
Parser-agnostic: works with any AST node implementing FunctionNode interface. Uses dedicated parser for child entities (parameters).
Traits
Shared attribute detection logic for stub parsers.
Methods
No description
Parses stub code string into PHPFunction.
Extract and parse all functions from stub content.
Details
__construct(FunctionNodeExtractorInterface|null $nodeExtractor = null, PhpDocParserInterface|null $phpDocParser = null, TypeParserInterface|null $typeParser = null, AvailableVersionParserInterface|null $versionParser = null)
No description
PHPFunction
parse(string $stubCode)
Parses stub code string into PHPFunction.
This is a convenience method that delegates to parseNode().
PHPFunction
parseNode(FunctionNode $node)
Parses a function AST node into PHPFunction domain object.
Works with any FunctionNode implementation (parser-agnostic).
array
extractAndParseAll(string $stubContent)
Extract and parse all functions from stub content.