Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a1ab939

Browse filesBrowse files
committed
[Serializer] fixed CS
1 parent 6d9f0be commit a1ab939
Copy full SHA for a1ab939

File tree

Expand file treeCollapse file tree

3 files changed

+9
-11
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+9
-11
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Serializer/Encoder/JsonDecode.php
+3-3Lines changed: 3 additions & 3 deletions
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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Serializer/Encoder/JsonEncode.php
+3-3Lines changed: 3 additions & 3 deletions
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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Serializer/Encoder/JsonEncoder.php
+3-5Lines changed: 3 additions & 5 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.