Added 'double' to \RTEX\Abstracts > VariableType
This commit is contained in:
parent
47b434b625
commit
66cd6d0625
2 changed files with 8 additions and 1 deletions
|
@ -10,6 +10,8 @@
|
||||||
|
|
||||||
const Float = 'float';
|
const Float = 'float';
|
||||||
|
|
||||||
|
const Double = 'double';
|
||||||
|
|
||||||
const Boolean = 'boolean';
|
const Boolean = 'boolean';
|
||||||
|
|
||||||
const Array = 'array';
|
const Array = 'array';
|
||||||
|
@ -22,6 +24,7 @@
|
||||||
self::String,
|
self::String,
|
||||||
self::Integer,
|
self::Integer,
|
||||||
self::Float,
|
self::Float,
|
||||||
|
self::Double,
|
||||||
self::Boolean,
|
self::Boolean,
|
||||||
self::Array,
|
self::Array,
|
||||||
self::Null,
|
self::Null,
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
* @return string
|
* @return string
|
||||||
* @throws TypeException
|
* @throws TypeException
|
||||||
*/
|
*/
|
||||||
public static function determineType($input): string
|
public static function getType($input): string
|
||||||
{
|
{
|
||||||
if ($input instanceof InstructionInterface)
|
if ($input instanceof InstructionInterface)
|
||||||
return VariableType::Instruction;
|
return VariableType::Instruction;
|
||||||
|
@ -25,6 +25,8 @@
|
||||||
return VariableType::Integer;
|
return VariableType::Integer;
|
||||||
if (is_float($input))
|
if (is_float($input))
|
||||||
return VariableType::Float;
|
return VariableType::Float;
|
||||||
|
if (is_double($input))
|
||||||
|
return VariableType::Double;
|
||||||
if (is_bool($input))
|
if (is_bool($input))
|
||||||
return VariableType::Boolean;
|
return VariableType::Boolean;
|
||||||
if (is_array($input))
|
if (is_array($input))
|
||||||
|
@ -88,6 +90,8 @@
|
||||||
return 'int(' . $input . ')';
|
return 'int(' . $input . ')';
|
||||||
if(is_float($input))
|
if(is_float($input))
|
||||||
return 'float(' . $input . ')';
|
return 'float(' . $input . ')';
|
||||||
|
if(is_double($input))
|
||||||
|
return 'double(' . $input . ')';
|
||||||
if(is_bool($input))
|
if(is_bool($input))
|
||||||
return $input ? 'True' : 'False';
|
return $input ? 'True' : 'False';
|
||||||
if(is_null($input))
|
if(is_null($input))
|
||||||
|
|
Loading…
Add table
Reference in a new issue