CustomVariable: add support for creating new types

This commit is contained in:
Thomas Gelf 2015-10-28 22:27:53 +01:00
parent 5886765e37
commit 7298092e97
1 changed files with 8 additions and 0 deletions

View File

@ -128,6 +128,14 @@ abstract class CustomVariable implements IcingaConfigRenderer
return new CustomVariableNull($key, $value);
}
if (is_bool($value)) {
return new CustomVariableBoolean($key, $value);
}
if (is_int($value) || is_float($value)) {
return new CustomVariableNumber($key, $value);
}
if (is_string($value)) {
return new CustomVariableString($key, $value);