Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Delete json_encode/decode exceptions

  • Loading branch information...
commit 393cba9d8ac08d68bdb91311af76b4e030d27e47 1 parent 4e01dbf
@Baachi Baachi authored
View
27 lib/Doctrine/Search/Exception/Json/JsonDecodeException.php
@@ -1,27 +0,0 @@
-<?php
-namespace Doctrine\Search\Exception\Json;
-
-use \Doctrine\Search\Exception\DoctrineSearchException;
-
-class JsonDecodeException extends DoctrineSearchException
-{
-
- static private $errors = array(
- JSON_ERROR_NONE => 'unknown error',
- JSON_ERROR_DEPTH => 'maximum stack depth has been exceeded',
- JSON_ERROR_STATE_MISMATCH => 'invalid or malformed JSON',
- JSON_ERROR_SYNTAX => 'Syntax error',
- JSON_ERROR_CTRL_CHAR => 'Control character error',
- JSON_ERROR_UTF8 => 'Malformed UTF-8 characters',
- );
-
- public function __construct()
- {
- $message = sprintf(
- 'Failure by decode from json [%s]',
- static::$errors[json_last_error()]
- );
-
- parent::__construct($message);
- }
-}
View
28 lib/Doctrine/Search/Exception/Json/JsonEncodeException.php
@@ -1,28 +0,0 @@
-<?php
-namespace Doctrine\Search\Exception\Json;
-
-use \Doctrine\Search\Exception\DoctrineSearchException;
-
-class JsonEncodeException extends DoctrineSearchException
-{
-
- static private $errors = array(
- JSON_ERROR_NONE => 'unknown error',
- JSON_ERROR_DEPTH => 'maximum stack depth has been exceeded',
- JSON_ERROR_STATE_MISMATCH => 'invalid or malformed JSON',
- JSON_ERROR_SYNTAX => 'Syntax error',
- JSON_ERROR_CTRL_CHAR => 'Control character error',
- JSON_ERROR_UTF8 => 'Malformed UTF-8 characters',
- );
-
- public function __construct($value)
- {
- $message = sprintf(
- 'Failure by encode %s to json [%s]',
- (is_object($value) ? get_class($value) : gettype($value)),
- static::$errors[json_last_error()]
- );
-
- parent::__construct($message);
- }
-}
Please sign in to comment.
Something went wrong with that request. Please try again.