From 7298092e97ffff2cfb81f9c0c5736f586c998f83 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Wed, 28 Oct 2015 22:27:53 +0100 Subject: [PATCH] CustomVariable: add support for creating new types --- library/Director/CustomVariable/CustomVariable.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/library/Director/CustomVariable/CustomVariable.php b/library/Director/CustomVariable/CustomVariable.php index 579b49f1..c34ebf0f 100644 --- a/library/Director/CustomVariable/CustomVariable.php +++ b/library/Director/CustomVariable/CustomVariable.php @@ -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);