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

Skip to content

Commit a1ab939

Browse files
committed
[Serializer] fixed CS
1 parent 6d9f0be commit a1ab939

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

src/Symfony/Component/Serializer/Encoder/JsonDecode.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ public function __construct($associative = false, $depth = 512)
5555
*
5656
* @return integer
5757
*
58-
* @deprecated decode() throws an exception if error found
58+
* @deprecated since 2.5, decode() throws an exception if error found, will be removed in 3.0
59+
*
5960
* @see http://php.net/manual/en/function.json-last-error.php json_last_error
6061
*/
6162
public function getLastError()
@@ -105,8 +106,7 @@ public function decode($data, $format, array $context = array())
105106
}
106107

107108
if (JSON_ERROR_NONE !== $this->lastError = json_last_error()) {
108-
$message = JsonEncoder::getLastErrorMessage();
109-
throw new UnexpectedValueException($message);
109+
throw new UnexpectedValueException(JsonEncoder::getLastErrorMessage());
110110
}
111111

112112
return $decodedData;

src/Symfony/Component/Serializer/Encoder/JsonEncode.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ public function __construct($bitmask = 0)
3333
*
3434
* @return integer
3535
*
36-
* @deprecated encode() throws an exception if error found
36+
* @deprecated since 2.5, encode() throws an exception if error found, will be removed in 3.0
37+
*
3738
* @see http://php.net/manual/en/function.json-last-error.php json_last_error
3839
*/
3940
public function getLastError()
@@ -53,8 +54,7 @@ public function encode($data, $format, array $context = array())
5354
$encodedJson = json_encode($data, $context['json_encode_options']);
5455

5556
if (JSON_ERROR_NONE !== $this->lastError = json_last_error()) {
56-
$message = JsonEncoder::getLastErrorMessage();
57-
throw new UnexpectedValueException($message);
57+
throw new UnexpectedValueException(JsonEncoder::getLastErrorMessage());
5858
}
5959

6060
return $encodedJson;

src/Symfony/Component/Serializer/Encoder/JsonEncoder.php

+3-5
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,23 @@ public function __construct(JsonEncode $encodingImpl = null, JsonDecode $decodin
3737
}
3838

3939
/**
40-
*
4140
* Returns the last encoding error (if any)
4241
*
4342
* @return integer
4443
*
45-
* @deprecated JsonEncode throws exception if an error is found
44+
* @deprecated since 2.5, JsonEncode throws exception if an error is found, will be removed in 3.0
4645
*/
4746
public function getLastEncodingError()
4847
{
4948
return $this->encodingImpl->getLastError();
5049
}
5150

5251
/**
53-
*
5452
* Returns the last decoding error (if any)
5553
*
5654
* @return integer
5755
*
58-
* @deprecated JsonDecode throws exception if an error is found
56+
* @deprecated since 2.5, JsonDecode throws exception if an error is found, will be removed in 3.0
5957
*/
6058
public function getLastDecodingError()
6159
{
@@ -95,7 +93,7 @@ public function supportsDecoding($format)
9593
}
9694

9795
/**
98-
* Resolves json_last_error message
96+
* Resolves json_last_error message.
9997
*
10098
* @return string
10199
*/

0 commit comments

Comments
 (0)