Allow empty parameter values
[phancap.git] / src / phancap / Options.php
index 061230cf5f0b533e244dec0f3e1a061f61ae7e1d..d39af73218fafc31009f53db328a9f865ec33622 100644 (file)
@@ -144,7 +144,11 @@ class Options
                 continue;
             }
 
-            if ($arOption['type'] == 'url') {
+            if ($arValues[$name] === ''
+                && !isset($arOption['required'])
+            ) {
+                //allow empty value; default value will be used
+            } else if ($arOption['type'] == 'url') {
                 $this->values[$name] = $this->validateUrl($arValues[$name]);
             } else if ($arOption['type'] == 'int') {
                 $this->values[$name] = $this->validateInt(