diff --git a/composer.json b/composer.json index 41b089f..9c3472f 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ } ], "require" : { - "php" : ">=5.3.9", + "php" : ">=5.4.6", "mouf/mouf-installer" : "~2.0.1", "mouf/mouf-validators-interface" : "~2.0", "container-interop/container-interop" : "~1.0", diff --git a/src/Mouf/Reflection/MoufReflectionParameter.php b/src/Mouf/Reflection/MoufReflectionParameter.php index a698c0b..0a5c009 100644 --- a/src/Mouf/Reflection/MoufReflectionParameter.php +++ b/src/Mouf/Reflection/MoufReflectionParameter.php @@ -207,6 +207,9 @@ public function toJson() { // In some cases, the call to getDefaultValue can log NOTICES // in particular if an undefined constant is used as default value. ob_start(); + if ($this->isDefaultValueConstant() && !defined($this->getDefaultValueConstantName())) { + throw new \Exception('Constant "'.$this->getDefaultValueConstantName().'" does not exist.'); + } $result['default'] = $this->getDefaultValue(); $possibleError = ob_get_clean(); if ($possibleError) {