diff --git a/src/Exceptions/JsonParserException.php b/src/Exceptions/JsonParserException.php index 42acabf..0155410 100644 --- a/src/Exceptions/JsonParserException.php +++ b/src/Exceptions/JsonParserException.php @@ -10,9 +10,9 @@ use Exception; */ abstract class JsonParserException extends Exception { - public const CODE_SOURCE_INVALID = 0; - public const CODE_SOURCE_UNSUPPORTED = 1; - public const CODE_SOURCE_GUZZLE = 2; + public const SOURCE_INVALID = 0; + public const SOURCE_UNSUPPORTED = 1; + public const SOURCE_GUZZLE = 2; - public const CODE_POINTER_INVALID = 3; + public const POINTER_INVALID = 0; } diff --git a/src/Exceptions/PointerException.php b/src/Exceptions/PointerException.php index b17487d..7cc5504 100644 --- a/src/Exceptions/PointerException.php +++ b/src/Exceptions/PointerException.php @@ -16,6 +16,6 @@ class PointerException extends JsonParserException */ public static function invalid(string $pointer): static { - return new static("The string [$pointer] is not a valid JSON pointer", static::CODE_POINTER_INVALID); + return new static("The string [$pointer] is not a valid JSON pointer", static::POINTER_INVALID); } } diff --git a/src/Exceptions/SourceException.php b/src/Exceptions/SourceException.php index 9ce57c8..4fcf367 100644 --- a/src/Exceptions/SourceException.php +++ b/src/Exceptions/SourceException.php @@ -16,7 +16,7 @@ class SourceException extends JsonParserException */ public static function invalid(string $source): static { - return new static("[$source] is not a valid source", static::CODE_SOURCE_INVALID); + return new static("[$source] is not a valid source", static::SOURCE_INVALID); } /** @@ -26,7 +26,7 @@ class SourceException extends JsonParserException */ public static function unsupported(): static { - return new static('Unable to load JSON from the provided source', static::CODE_SOURCE_UNSUPPORTED); + return new static('Unable to load JSON from the provided source', static::SOURCE_UNSUPPORTED); } /** @@ -36,6 +36,6 @@ class SourceException extends JsonParserException */ public static function requireGuzzle(): static { - return new static('Guzzle is required to load JSON from endpoints', static::CODE_SOURCE_GUZZLE); + return new static('Guzzle is required to load JSON from endpoints', static::SOURCE_GUZZLE); } }