Parser

Parses doc comments

class Parser
Copyright
2016 Appertly
License
Apache-2.0

Constructors / Destructors

Public
ReturnsSignature and Description
void
__construct(?TagFactory $tagFactory = null)

Creates a new Parser.

Instance Methods

Public
ReturnsSignature and Description
Block
parse(?ScannedBase $token)

Parses a doc comment.

Block
parseString(?string $comment, ?ScannedBase $token = null)

Parses a doc comment string.

Protected
ReturnsSignature and Description
string
extract(string $comment)

Extract the content from the comment.

Method Details

__construct

public function __construct(?TagFactory $tagFactory = null)

Creates a new Parser.

Parameters
NameTypeDescription
$tagFactory?TagFactory

Optional. The factory to use.

extract

protected function extract(string $comment)

Extract the content from the comment.

Parameters
NameTypeDescription
$commentstring

The comment to clean up

Returns
TypeDescription
string

The extracted content

parse

public function parse(?ScannedBase $token)

Parses a doc comment.

Parameters
NameTypeDescription
$token?ScannedBase

The token whose doc comment will be evaluated

Returns
TypeDescription
Block

The parsed block

parseString

public function parseString(?string $comment, ?ScannedBase $token = null)

Parses a doc comment string.

Parameters
NameTypeDescription
$comment?string

The doc comment

$token?ScannedBase

The token whose doc comment will be evaluated

Returns
TypeDescription
Block

The parsed block