ConvertToIntegerTrait
Trait ConvertToIntegerTrait.
Trait to cast an input value to integer.
Table of Contents
- fromArrayToInteger() : mixed
- Convert an array to an integer.
- fromBooleanToInteger() : int
- Convert a boolean to an integer.
- fromFileToInteger() : mixed
- Convert a file to an integer.
- fromFloatToInteger() : int|float
- Convert a float to an integer.
- fromHtmlToInteger() : mixed
- Convert an HTML string to an integer.
- fromImageToInteger() : mixed
- Convert an image to an integer.
- fromIntegerToInteger() : int
- Convert an integer to an integer.
- fromJsonToInteger() : float|int|null
- Convert a JSON string to an integer.
- fromTextToInteger() : int|float|null
- Convert text to an integer.
- fromUndefinedToInteger() : null
- Convert undefined to integer.
- fromXmlToInteger() : mixed
- Convert an XML string to an integer.
Methods
fromArrayToInteger()
Convert an array to an integer.
public
fromArrayToInteger(array<string|int, mixed> $array) : mixed
Parameters
- $array : array<string|int, mixed>
Tags
Return values
mixed —fromBooleanToInteger()
Convert a boolean to an integer.
public
fromBooleanToInteger(bool $boolean) : int
Parameters
- $boolean : bool
Return values
int —fromFileToInteger()
Convert a file to an integer.
public
fromFileToInteger( $file) : mixed
Parameters
Tags
Return values
mixed —fromFloatToInteger()
Convert a float to an integer.
public
fromFloatToInteger(float $float) : int|float
Parameters
- $float : float
Tags
Return values
int|float —fromHtmlToInteger()
Convert an HTML string to an integer.
public
fromHtmlToInteger(string $html) : mixed
Parameters
- $html : string
Tags
Return values
mixed —fromImageToInteger()
Convert an image to an integer.
public
fromImageToInteger( $image) : mixed
Parameters
Tags
Return values
mixed —fromIntegerToInteger()
Convert an integer to an integer.
public
fromIntegerToInteger(int $integer) : int
Parameters
- $integer : int
Return values
int —fromJsonToInteger()
Convert a JSON string to an integer.
public
fromJsonToInteger(string $json) : float|int|null
Parameters
- $json : string
Tags
Return values
float|int|null —fromTextToInteger()
Convert text to an integer.
public
fromTextToInteger(string $text) : int|float|null
Parameters
- $text : string
Tags
Return values
int|float|null —fromUndefinedToInteger()
Convert undefined to integer.
public
fromUndefinedToInteger( $data) : null
Parameters
Return values
null —fromXmlToInteger()
Convert an XML string to an integer.
public
fromXmlToInteger(string $xml) : mixed
Parameters
- $xml : string