<?php
 namespace apimatic\jsonmapper; use Exception; class JsonMapperException extends Exception { static function commentsDisabledInConfigurationException($concernedKeys) { return new self( "Comments cannot be discarded in the configuration file i.e." . " the php.ini file; doc comments are a requirement for JsonMapper." . " Following configuration keys must have a value set to \"1\": " . implode(", ", $concernedKeys) . "." ); } static function undefinedPropertyException( $key, $class, $setterException = false ) { $err = $setterException ? 'has no public setter method' : 'does not exist'; return new self("JSON property '$key' $err in object of type '$class'"); } static function missingTypePropertyException($key, $strClassName) { return new self("Empty type at property '$strClassName::$$key'"); } static function unCallableFactoryMethodException($factoryMethod, $strClassName) { return new self( "Factory method '$factoryMethod' referenced by " . "'$strClassName' is not callable." ); } static function invalidArgumentFactoryMethodException($argType, $reasons) { return new self( "Provided factory methods are not callable with " . "the value of Type: $argType\n$reasons" ); } static function unableToMapException($typeName, $typeGroup, $value) { return new self("Unable to map $typeName: $typeGroup on: $value"); } static function moreThanOneOfException($matchedType, $mappedWith, $json) { return new self( "Cannot map more than OneOf { $matchedType and $mappedWith } on: $json" ); } static function cannotMapAnyOfException($type, $json) { return new self("Unable to map AnyOf $type on: $json"); } static function requiredPropertyMissingException($propertyName, $className) { return new self( "Required property '$propertyName' of class " . "'$className' is missing in JSON data" ); } static function noArgumentsException($class, $ctorReqParamNumber) { return new self( "$class class requires $ctorReqParamNumber " . "arguments in constructor but none provided" ); } static function fewerArgumentsException($class, $ctorRequiredParamsName) { return new self( "Could not find required constructor arguments for $class: " . implode(", ", $ctorRequiredParamsName) ); } static function unableToSetTypeException($type, $value) { return new self("Could not set type '$type' on value: $value"); } } 