mirror of
https://github.com/cerbero90/json-parser.git
synced 2025-01-17 04:58:15 +01:00
Rename codes
This commit is contained in:
parent
b92193cda9
commit
ed1def1572
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user