StubInterfaceParser
class StubInterfaceParser implements MultiEntityStubParserInterface (View source)
Parses PHP interface nodes from AST into PHPInterface domain objects.
Parser-agnostic: works with any AST node implementing InterfaceNode interface. Uses dedicated parsers for child entities (methods, constants).
Methods
No description
Parses stub code string into PHPInterface.
Parses an interface AST node into PHPInterface domain object.
Extract and parse all interfaces from stub content.
Details
__construct(InterfaceNodeExtractorInterface|null $nodeExtractor = null, PhpDocParserInterface|null $phpDocParser = null, TypeParserInterface|null $typeParser = null, AvailableVersionParserInterface|null $versionParser = null)
No description
PHPInterface
parse(string $stubCode)
Parses stub code string into PHPInterface.
Convenience wrapper that delegates to parseNode() without imports, so a parent
declared via a use statement resolves against the declaring namespace rather than
the imported one. Production parsing goes through extractAndParseAll(), which supplies
them; prefer that whenever import handling matters.
PHPInterface
parseNode(InterfaceNode $node, array $imports = [])
Parses an interface AST node into PHPInterface domain object.
Works with any InterfaceNode implementation (parser-agnostic).
array
extractAndParseAll(string $stubContent)
Extract and parse all interfaces from stub content.