DocBlock
The prose and tags of one docblock, already separated into the parts a page renders.
Types here are still the raw strings the author wrote. Turning them into a TypeRef needs the declaring file’s imports, which only the reflector has, so that conversion happens there rather than at parse time.
Synopsis
Section titled “Synopsis”final class DocBlock
| Source | Ir/DocBlock.php |
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
$deprecated | ?``string | readonly. |
$description | string | readonly. |
$inheritsDoc | bool | readonly. |
$internal | bool | readonly. |
$paramDescriptions | array | readonly. |
$paramTypes | array | readonly. |
$returnDescription | string | readonly. |
$returnType | ?``string | readonly. |
$see | array | readonly. |
$since | ?``string | readonly. |
$summary | string | readonly. |
$throws | array | readonly. |
Constructor
Section titled “Constructor”__construct()
Section titled “__construct()”public function __construct(string $summary = '', string $description = '', array<string, string> $paramDescriptions = [], array<string, string> $paramTypes = [], ?string $returnType = null, string $returnDescription = '', list<array{type: string, description: string}> $throws = [], ?string $deprecated = null, bool $internal = false, ?string $since = null, list<string> $see = [], bool $inheritsDoc = false): mixed
Raw @see targets, in source order.
| Parameter | Type | Description |
|---|---|---|
$summary | string | |
$description | string | |
$paramDescriptions | array``<``string``, ``string``> | Parameter name (no $) => description. |
$paramTypes | array``<``string``, ``string``> | Parameter name (no $) => raw type text. |
$returnType | ?``string | |
$returnDescription | string | |
$throws | list``<``array{type: string, description: string}``> | |
$deprecated | ?``string | |
$internal | bool | |
$since | ?``string | |
$see | list``<``string``> | Raw @see targets, in source order. |
$inheritsDoc | bool |
Returns mixed
Methods
Section titled “Methods”| Method | Description |
|---|---|
empty(): DocBlock | |
inheritFrom(DocBlock $parent): DocBlock | Returns a copy carrying $parent’s prose wherever this block left it out. |
isEmpty(): bool |
empty()
Section titled “empty()”public static function empty(): DocBlock
Returns DocBlock
inheritFrom()
Section titled “inheritFrom()”public function inheritFrom(DocBlock $parent): DocBlock
Returns a copy carrying $parent’s prose wherever this block left it out.
Used for “, and for the common case of an override with tags but no summary: the ancestor’s description is the right one, and the override’s own tags still win because they describe this signature.
| Parameter | Type | Description |
|---|---|---|
$parent | DocBlock |
Returns DocBlock
isEmpty()
Section titled “isEmpty()”public function isEmpty(): bool
Returns bool