TypeConversion
class TypeConversion (View source)
Type conversion utility class
Methods
static
to(mixed $value, string $type, callable $fallback)
No description
static array
toArray(mixed $value, callable $fallback = null)
Convert value to POD array
static DateTimeInterface
toDateTime(mixed $value, DateTimeZone $timezone = null, callable $fallback = null)
Convert value to DateTime
static integer
toInteger(mixed $value, callable $fallback = null)
Convert value to integer
static float
toFloat(mixed $value, callable $fallback = null)
Convert value to float
static string
toString(mixed $value, callable $fallback = null)
Convert value to string
static boolean
toBoolean(mixed $value)
Convert value to boolean
Details
at line 30
static
to(mixed $value, string $type, callable $fallback)
at line 54
static array
toArray(mixed $value, callable $fallback = null)
Convert value to POD array
at line 86
static DateTimeInterface
toDateTime(mixed $value, DateTimeZone $timezone = null, callable $fallback = null)
Convert value to DateTime
at line 158
static integer
toInteger(mixed $value, callable $fallback = null)
Convert value to integer
at line 196
static float
toFloat(mixed $value, callable $fallback = null)
Convert value to float
at line 237
static string
toString(mixed $value, callable $fallback = null)
Convert value to string
at line 291
static boolean
toBoolean(mixed $value)
Convert value to boolean