diff --git a/src/Error/ApiError.php b/src/Error/ApiError.php index d7d81b6b6d..018cf9424d 100644 --- a/src/Error/ApiError.php +++ b/src/Error/ApiError.php @@ -34,7 +34,7 @@ public function fieldDefinitions() public static function fromArray(array $data, $context = null) { if (isset($data['code'])) { - $className = sprintf('\Commercetools\Core\Error\%sError', self::pascalcase($data['code'])); + $className = sprintf('\Commercetools\Core\Error\%sError', self::pascalCase($data['code'])); if (class_exists($className)) { return new $className($data, $context); } @@ -42,7 +42,7 @@ public static function fromArray(array $data, $context = null) return new static($data, $context); } - protected static function pascalcase($name) + protected static function pascalCase($name) { return ucfirst( implode( diff --git a/src/Error/DiscountCodeNonApplicableError.php b/src/Error/DiscountCodeNonApplicableError.php new file mode 100644 index 0000000000..adf3d72726 --- /dev/null +++ b/src/Error/DiscountCodeNonApplicableError.php @@ -0,0 +1,21 @@ + + */ + +namespace Commercetools\Core\Error; + +use Commercetools\Core\Model\Common\Attribute; + +/** + * @package Commercetools\Core\Error + * + * @method string getCode() + * @method DiscountCodeNonApplicableError setCode(string $code = null) + * @method string getMessage() + * @method DiscountCodeNonApplicableError setMessage(string $message = null) + */ +class DiscountCodeNonApplicableError extends ApiError +{ + const CODE = 'DiscountCodeNonApplicable'; +} diff --git a/src/Error/InvalidTokenError.php b/src/Error/InvalidTokenError.php index b0db07c448..c10befa82b 100644 --- a/src/Error/InvalidTokenError.php +++ b/src/Error/InvalidTokenError.php @@ -9,9 +9,9 @@ * @package Commercetools\Core\Error * * @method string getCode() - * @method AccessDeniedError setCode(string $code = null) + * @method InvalidTokenError setCode(string $code = null) * @method string getMessage() - * @method AccessDeniedError setMessage(string $message = null) + * @method InvalidTokenError setMessage(string $message = null) */ class InvalidTokenError extends ApiError {