updated FML

This commit is contained in:
kremsy
2017-06-21 19:43:38 +02:00
parent 68a0c493ae
commit dd0572d7b2
16 changed files with 649 additions and 472 deletions

View File

@ -69,6 +69,30 @@ abstract class Builder
return static::escapeText($element->getId(), false);
}
/**
* Get the 'Text' string representation of the given value
*
* @api
* @param string $value String value to convert to a ManiaScript 'Text'
* @return string
*/
public static function getText($value)
{
return '"' . (string)$value . '"';
}
/**
* Get the 'Integer' string representation of the given value
*
* @api
* @param int $value Int value to convert to a ManiaScript 'Integer'
* @return string
*/
public static function getInteger($value)
{
return (string)(int)$value;
}
/**
* Get the 'Real' string representation of the given value
*
@ -146,7 +170,7 @@ abstract class Builder
* @param bool $associative (optional) Whether the array should be associative
* @return string
*/
public static function getArray(array $array, $associative = false)
public static function getArray(array $array, $associative = true)
{
$arrayText = "[";
$index = 0;
@ -180,6 +204,9 @@ abstract class Builder
if (is_bool($value)) {
return static::getBoolean($value);
}
if (is_array($value)) {
return static::getArray($value);
}
return $value;
}