getValueType()
getValueType(mixed $value) : \Phabstractic\Data\Types\Type|boolean
Generates an enumerated Type representative value from a given variable
This steps through the various type tests PHP is able to do to determine the type of a variable (bool, int, etc.) and then returns that type as a representative value from the Type Class above (an actual instance).
Note: With a Typed Object, the enumeration instance includes the immediate class value available from get_class of the value regardless of inheritance, implementation, or trait
Note: This function only checks user-defined functions for 'function' type. Not internal functions. The 'function' type is based on the string type, so it supersedes the string type if evaluated as true.
Important: This returns a enumeration object with an enumeration value. Unless a typed object, then returns an array with an enumeration object with an enumerated value, AND the object.
VERSION 3 INFORMATION:
Parameters
mixed | $value | The variable we wish to determine |
Returns
\Phabstractic\Data\Types\Type|boolean —The enumeration instance, or false on 'failure'