TypeDescription
class TypeDescription (View source)
Universal type description utility class
Constants
| UNKNOWN |
Constant for unknown type or type family |
| FAMILY_PRIMITIVE |
PHP primitive type |
| FAMILY_PSEUDO_TYPE |
Pseudo type (void, mixed) |
Methods
No description
Get the local class name (class name without namespace)
Get the list of namespace where the class live.
Indicates if the given element is of given class name.
Indicates if the type name refer to a PHP primitive type
Indicates if the given type name refer to a pseudo-type.
Get type name family
Indicates if the given element is a subclass of a given class name.
Indicates if the given variable can be converted to string using TypeConversion utility
Details
at line 30
static string
getName(mixed $element)
at line 51
static Local
getLocalName(object|string $element, boolean $elementIsClassName = false)
Get the local class name (class name without namespace)
This function is equivalent to ReflectionClass::getShourName() for classes and gettype() for other data types
at line 79
static array
getNamespaces(mixed $element, boolean $elementIsClassName = false)
Get the list of namespace where the class live.
at line 107
static boolean
isA($element, $parent, $elementIsClassName = false)
Indicates if the given element is of given class name.
This method is equivalent to is_subclass_of
at line 129
static boolean
isPrimitiveType(stringown $typename)
Indicates if the type name refer to a PHP primitive type
at line 159
static boolean
isPseudoType(string $typename)
Indicates if the given type name refer to a pseudo-type.
Pseudo-types may appear in PHPDoc blocks or in function definitions.
at line 194
static string
getTypenameFamily(string $typename)
Get type name family
at line 215
static boolean
isSubclassOf($element, $parent, $elementIsClassName = false)
Indicates if the given element is a subclass of a given class name.
This method is equivalent to is_subclass_of
at line 241
static boolean
hasStringRepresentation(mixed $element, boolean $strict = true)
Indicates if the given variable can be converted to string using TypeConversion utility