Guides

Parser
in package

FinalYes

Determines the correct markup language parser to use based on the input and output format and with it, and parses the file contents.

Table of Contents

Properties

$documentNameResolver  : DocumentNameResolverInterface
$parserContext  : ParserContext|null
$parserStrategies  : array<string|int, MarkupLanguageParser>

Methods

__construct()  : mixed
parse()  : DocumentNode
prepare()  : void
registerStrategy()  : void
createParserContext()  : ParserContext
determineParser()  : MarkupLanguageParser

Properties

Methods

parse()

public parse(string $text[, string $inputFormat = 'rst' ]) : DocumentNode
Parameters
$text : string
$inputFormat : string = 'rst'
Return values
DocumentNode

prepare()

public prepare(FilesystemInterface|null $origin, string $sourcePath, string $fileName, ProjectNode $projectNode[, int $initialHeaderLevel = 1 ]) : void
Parameters
$origin : FilesystemInterface|null
$sourcePath : string
$fileName : string
$projectNode : ProjectNode
$initialHeaderLevel : int = 1
Tags
psalm-assert

ParserContext $this->parserContext

createParserContext()

private createParserContext(string $sourcePath, string $file, FilesystemInterface $origin, int $initialHeaderLevel, ProjectNode $projectNode) : ParserContext
Parameters
$sourcePath : string
$file : string
$origin : FilesystemInterface
$initialHeaderLevel : int
$projectNode : ProjectNode
Return values
ParserContext

        
On this page

Search results