Skip to content

ClassDoc

Everything one page needs about one class, interface, trait or enum.

final class ClassDoc

SourceIr/ClassDoc.php
PropertyTypeDescription
$abstractboolreadonly.
$backingType?``stringreadonly.
$casesarrayreadonly.
$constantsarrayreadonly.
$constructor?MethodDocreadonly.
$docDocBlockreadonly.
$finalboolreadonly.
$fqcnstringreadonly.
$implementedByarrayreadonly.
$inheritedMethodsarrayreadonly.
$interfacesarrayreadonly.
$kindstringreadonly.
$methodsarrayreadonly.
$namespacestringreadonly.
$parent?TypeRefreadonly.
$propertiesarrayreadonly.
$readonlyboolreadonly.
$shortNamestringreadonly.
$sourcePathstringreadonly.
$traitsarrayreadonly.

public function __construct(string $fqcn, string $shortName, string $namespace, 'class'|'interface'|'trait'|'enum' $kind, DocBlock $doc, string $sourcePath, bool $abstract = false, bool $final = false, bool $readonly = false, ?TypeRef $parent = null, list<TypeRef> $interfaces = [], list<TypeRef> $traits = [], list<ConstantDoc> $constants = [], list<EnumCaseDoc> $cases = [], list<PropertyDoc> $properties = [], ?MethodDoc $constructor = null, list<MethodDoc> $methods = [], list<InheritedMember> $inheritedMethods = [], list<string> $implementedBy = [], ?string $backingType = null): mixed

Fully-qualified names, filled in once every class is known.

ParameterTypeDescription
$fqcnstring
$shortNamestring
$namespacestring
$kind`‘class’“'interface'
$docDocBlock
$sourcePathstring
$abstractbool
$finalbool
$readonlybool
$parent?TypeRef
$interfaceslist``<TypeRef>
$traitslist``<TypeRef>
$constantslist``<ConstantDoc>
$caseslist``<EnumCaseDoc>
$propertieslist``<PropertyDoc>
$constructor?MethodDoc
$methodslist``<MethodDoc>Declared here, trait-composed included.
$inheritedMethodslist``<InheritedMember>
$implementedBylist``<``string``>Fully-qualified names, filled in once every class is known.
$backingType?``string

Returns mixed

MethodDescription
declaration(): stringThe declaration line, as it would be written in source.
namespaceSegments(): list<string>
withImplementedBy(list<string> $implementedBy): ClassDoc

public function declaration(): string

The declaration line, as it would be written in source.

Returns string

public function namespaceSegments(): list<string>

Returns list``<``string``> — The namespace split into segments below the framework root.

public function withImplementedBy(list<string> $implementedBy): ClassDoc

ParameterTypeDescription
$implementedBylist``<``string``>

Returns ClassDoc