Documentation

DocBlock
in package

FinalYes

This class represents a docblock.

It internally splits it up into "lines" that we can manipulate.

Tags
author

Graham Campbell hello@gjcampbell.co.uk

Table of Contents

Properties

$annotations  : null|array<int, Annotation>
$lines  : array<int, Line>
$namespace  : NamespaceAnalysis|null
$namespaceUses  : array<int, NamespaceUseAnalysis>

Methods

__construct()  : mixed
__toString()  : string
getAnnotation()  : Annotation|null
getAnnotations()  : array<int, Annotation>
Get this docblock's annotations.
getAnnotationsOfType()  : array<int, Annotation>
Get specific types of annotations only.
getContent()  : string
Get the actual content of this docblock.
getLine()  : Line|null
Get a single line.
getLines()  : array<int, Line>
Get this docblock's lines.
isMultiLine()  : bool
makeMultiLine()  : void
Take a one line doc block, and turn it into a multi line doc block.
makeSingleLine()  : void
findAnnotationLength()  : int
getSingleLineDocBlockEntry()  : string

Properties

$namespace

private NamespaceAnalysis|null $namespace

$namespaceUses

private array<int, NamespaceUseAnalysis> $namespaceUses

Methods

__construct()

public __construct(string $content[, NamespaceAnalysis|null $namespace = null ][, array<int, NamespaceUseAnalysis$namespaceUses = [] ]) : mixed
Parameters
$content : string
$namespace : NamespaceAnalysis|null = null
$namespaceUses : array<int, NamespaceUseAnalysis> = []

__toString()

public __toString() : string
Return values
string

getAnnotationsOfType()

Get specific types of annotations only.

public getAnnotationsOfType(array<int, string>|string $types) : array<int, Annotation>
Parameters
$types : array<int, string>|string
Return values
array<int, Annotation>

getContent()

Get the actual content of this docblock.

public getContent() : string
Return values
string

getLine()

Get a single line.

public getLine(int $pos) : Line|null
Parameters
$pos : int
Return values
Line|null

getLines()

Get this docblock's lines.

public getLines() : array<int, Line>
Return values
array<int, Line>

isMultiLine()

public isMultiLine() : bool
Return values
bool

makeMultiLine()

Take a one line doc block, and turn it into a multi line doc block.

public makeMultiLine(string $indent, string $lineEnd) : void
Parameters
$indent : string
$lineEnd : string

makeSingleLine()

public makeSingleLine() : void

findAnnotationLength()

private findAnnotationLength(int $start) : int
Parameters
$start : int
Return values
int

getSingleLineDocBlockEntry()

private getSingleLineDocBlockEntry(Line $line) : string
Parameters
$line : Line
Return values
string

        
On this page

Search results