feature #13444 [Serializer] Remove deprecated JSON error methods (dunglas)

This PR was merged into the 3.0-dev branch.

Discussion
----------

[Serializer] Remove deprecated JSON error methods

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT
| Doc PR       | n/a

Remove deprecated methods of the Serializer component.

Commits
-------

269aca6 [Serializer] Remove deprecated JSON error methods
This commit is contained in:
Fabien Potencier 2015-01-19 17:17:28 +01:00
commit f7395c71b9
3 changed files with 0 additions and 62 deletions

View File

@ -50,23 +50,6 @@ class JsonDecode implements DecoderInterface
$this->recursionDepth = (int) $depth;
}
/**
* Returns the last decoding error (if any).
*
* @return int
*
* @deprecated since version 2.5, to be removed in 3.0.
* The {@self decode()} method throws an exception if error found.
*
* @see http://php.net/manual/en/function.json-last-error.php json_last_error
*/
public function getLastError()
{
trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Catch the exception raised by the decode() method instead to get the last JSON decoding error.', E_USER_DEPRECATED);
return $this->lastError;
}
/**
* Decodes data.
*

View File

@ -28,23 +28,6 @@ class JsonEncode implements EncoderInterface
$this->options = $bitmask;
}
/**
* Returns the last encoding error (if any).
*
* @return int
*
* @deprecated since version 2.5, to be removed in 3.0.
* The {@self encode()} throws an exception if error found.
*
* @see http://php.net/manual/en/function.json-last-error.php json_last_error
*/
public function getLastError()
{
trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Catch the exception raised by the encode() method instead to get the last JSON encoding error.', E_USER_DEPRECATED);
return $this->lastError;
}
/**
* Encodes PHP data to a JSON string.
*

View File

@ -36,34 +36,6 @@ class JsonEncoder implements EncoderInterface, DecoderInterface
$this->decodingImpl = $decodingImpl ?: new JsonDecode(true);
}
/**
* Returns the last encoding error (if any).
*
* @return int
*
* @deprecated since version 2.5, to be removed in 3.0. JsonEncode throws exception if an error is found.
*/
public function getLastEncodingError()
{
trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Catch the exception raised by the Symfony\Component\Serializer\Encoder\JsonEncode::encode() method instead to get the last JSON encoding error.', E_USER_DEPRECATED);
return $this->encodingImpl->getLastError();
}
/**
* Returns the last decoding error (if any).
*
* @return int
*
* @deprecated since version 2.5, to be removed in 3.0. JsonDecode throws exception if an error is found.
*/
public function getLastDecodingError()
{
trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Catch the exception raised by the Symfony\Component\Serializer\Encoder\JsonDecode::decode() method instead to get the last JSON decoding error.', E_USER_DEPRECATED);
return $this->decodingImpl->getLastError();
}
/**
* {@inheritdoc}
*/