Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Serializer] Remove deprecated JSON error methods #13444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions src/Symfony/Component/Serializer/Encoder/JsonDecode.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,6 @@ public function __construct($associative = false, $depth = 512)
$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.
*
Expand Down
17 changes: 0 additions & 17 deletions src/Symfony/Component/Serializer/Encoder/JsonEncode.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,6 @@ public function __construct($bitmask = 0)
$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.
*
Expand Down
28 changes: 0 additions & 28 deletions src/Symfony/Component/Serializer/Encoder/JsonEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,34 +36,6 @@ public function __construct(JsonEncode $encodingImpl = null, JsonDecode $decodin
$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}
*/
Expand Down