Methods |
public
static
|
getAllClassDocComments(
ReflectionClass<*> $class,
bool $fromClass = false,
bool $groupTraits = false,
): ($groupTraits is false ? ($fromClass is false ? array<class-string, string> : array<class-string, string|null>) : ($fromClass is false ? array<class-string, array<class-string, string>|string> : array<class-string, array<class-string, string|null>|string|null>))
Get an array of doc comments for a class and its parents
Get an array of doc comments for a class and its parents
Parameters
$fromClass |
If true , entries are returned for $class and
every parent, including any without doc comments.
|
$groupTraits |
If true , entries for traits are grouped with
class entries in a nested array.
|
|
#
|
public
static
|
getAllMethodDocComments(
ReflectionMethod $method,
ReflectionClass<*>|null $fromClass = null,
bool $groupTraits = false,
array<class-string, string|null>|null &$classDocComments = null,
): ($groupTraits is false ? ($fromClass is null ? array<class-string, string> : array<class-string, string|null>) : ($fromClass is null ? array<class-string, array<class-string, string>|string> : array<class-string, array<class-string, string|null>|string|null>))
Get an array of doc comments for a method from its declaring class and
its parents
Get an array of doc comments for a method from its declaring class and
its parents
Parameters
$fromClass |
If given, entries are
returned for $fromClass and every parent with $method , including any
without doc comments or where $method is not declared.
|
$groupTraits |
If true , entries for traits are grouped with
class entries in a nested array.
|
$classDocComments |
If given,
receives the doc comment of the declaring class for each entry in the
return value.
|
|
#
|
public
static
|
getAllPropertyDocComments(
ReflectionProperty $property,
ReflectionClass<*>|null $fromClass = null,
bool $groupTraits = false,
array<class-string, string|null>|null &$classDocComments = null,
): ($groupTraits is false ? ($fromClass is null ? array<class-string, string> : array<class-string, string|null>) : ($fromClass is null ? array<class-string, array<class-string, string>|string> : array<class-string, array<class-string, string|null>|string|null>))
Get an array of doc comments for a property from its declaring class and
its parents
Get an array of doc comments for a property from its declaring class and
its parents
Parameters
$fromClass |
If given, entries are
returned for $fromClass and every parent with $property , including
any without doc comments or where $property is not declared.
|
$groupTraits |
If true , entries for traits are grouped with
class entries in a nested array.
|
$classDocComments |
If given,
receives the doc comment of the declaring class for each entry in the
return value.
|
|
#
|
public
static
|
getAllConstantDocComments(
ReflectionClassConstant $constant,
ReflectionClass<*>|null $fromClass = null,
bool $groupTraits = false,
array<class-string, string|null>|null &$classDocComments = null,
): ($groupTraits is false ? ($fromClass is null ? array<class-string, string> : array<class-string, string|null>) : ($fromClass is null ? array<class-string, array<class-string, string>|string> : array<class-string, array<class-string, string|null>|string|null>))
Get an array of doc comments for a class constant from its declaring
class and its parents
Get an array of doc comments for a class constant from its declaring
class and its parents
Parameters
$fromClass |
If given, entries are
returned for $fromClass and every parent with $constant , including
any without doc comments or where $constant is not declared.
|
$groupTraits |
If true , entries for traits are grouped with
class entries in a nested array.
|
$classDocComments |
If given,
receives the doc comment of the declaring class for each entry in the
return value.
|
|
#
|
public
static
|
normaliseType(string $type, array<string, class-string> $aliases = [], bool $strict = false): string
Normalise a PHPDoc type
Normalise a PHPDoc type
If $strict is true , an exception is thrown if $type is not a valid
PHPDoc type.
|
#
|
public
static
|
removeTypeNamespaces(string $type): string
Remove PHP namespaces from a PHPDoc type
Remove PHP namespaces from a PHPDoc type
|
#
|
public
static
|
getParameterTag(
ReflectionParameter $parameter,
string $classPrefix = '\\',
(callable(class-string): (string|null))|null $callback = null,
string|null $type = null,
?string $name = null,
?string $documentation = null,
bool $force = false,
): ?string
Convert a ReflectionParameter to a PHPDoc tag
Convert a ReflectionParameter to a PHPDoc tag
Returns null if:
$force is not set,
$documentation is empty or null , and
- there is no difference between PHPDoc and native data types
Parameters
$callback |
Applied to
qualified class names if given. Must return null or an unqualified
alias.
|
$type |
If set, ignore the parameter's declared type and
use $type instead.
|
|
#
|
public
static
|
getParameterDeclaration(
ReflectionParameter $parameter,
string $classPrefix = '\\',
(callable(class-string): (string|null))|null $callback = null,
string|null $type = null,
?string $name = null,
bool $phpDoc = false,
): string
Convert a ReflectionParameter to a PHP parameter declaration
Convert a ReflectionParameter to a PHP parameter declaration
Parameters
$callback |
Applied to
qualified class names if given. Must return null or an unqualified
alias.
|
$type |
If set, ignore the parameter's declared type and
use $type instead. Do not use when generating code unless $type is
from a trusted source.
|
|
#
|
public
static
|
getTypeDeclaration(
?ReflectionType $type,
string $classPrefix = '\\',
(callable(class-string): (string|null))|null $callback = null,
bool $phpDoc = false,
): string
Convert a ReflectionType to a PHP type declaration
Convert a ReflectionType to a PHP type declaration
Parameters
$callback |
Applied to
qualified class names if given. Must return null or an unqualified
alias.
|
|
#
|