Proper Error Message for Missing Type in Getter for PayPalModel

- If missing annotation of return type in Getters, it throws a proper exception
- Improves #201
This commit is contained in:
japatel
2015-01-08 22:25:40 -06:00
parent b011d17cde
commit 0b43d599c4

View File

@@ -1,6 +1,7 @@
<?php <?php
namespace PayPal\Common; namespace PayPal\Common;
use PayPal\Exception\PayPalConfigurationException;
/** /**
* Class ReflectionUtil * Class ReflectionUtil
@@ -47,7 +48,7 @@ class ReflectionUtil
$anno = preg_split("/[\s\[\]]+/", $param); $anno = preg_split("/[\s\[\]]+/", $param);
return $anno[0]; return $anno[0];
} else { } else {
return 'string'; throw new PayPalConfigurationException("Getter function for '$propertyName' in '$class' class should have a proper return type.");
} }
} }