Methods |
public
static
|
getAllClassDocComments(
ReflectionClass<object> $class,
bool $includeAll = false,
): ($includeAll is false ? array<class-string, string> : array<class-string, 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
Returns an empty array if no doc comments are found for the class or any
extended classes or interfaces.
Parameters
$includeAll |
If true , entries are returned for $class and
every parent, including any without doc comments.
|
|
#
|
public
static
|
getAllMethodDocComments(
ReflectionMethod $method,
ReflectionClass<object>|null $fromClass = null,
array<class-string, string|null>|null &$classDocComments = null,
): ($fromClass is null ? array<class-string, string> : array<class-string, 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
Returns an empty array if no doc comments are found in the declaring
class or in any inherited classes, interfaces or traits.
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.
|
$classDocComments |
If given,
receives the doc comment of the declaring class for each entry in the
return value.
|
|
#
|
public
static
|
getAllPropertyDocComments(
ReflectionProperty $property,
ReflectionClass<object>|null $fromClass = null,
array<class-string, string|null>|null &$classDocComments = null,
): ($fromClass is null ? array<class-string, string> : array<class-string, 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
Returns an empty array if no doc comments are found in the declaring
class or in any inherited classes or traits.
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.
|
$classDocComments |
If given,
receives the doc comment of the declaring class for each entry in the
return value.
|
|
#
|
public
static
|
getAllConstantDocComments(
ReflectionClassConstant $constant,
ReflectionClass<object>|null $fromClass = null,
array<class-string, string|null>|null &$classDocComments = null,
): ($fromClass is null ? array<class-string, string> : array<class-string, 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
Returns an empty array if no doc comments are found in the declaring
class or in any inherited classes, interfaces or traits.
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.
|
$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.
|
|
#
|