Skip to content

Commit 44fc737

Browse files
committed
minor #25565 [2.7][DX] Use constant message contextualisation for deprecations (romainneutron)
This PR was merged into the 2.7 branch. Discussion ---------- [2.7][DX] Use constant message contextualisation for deprecations | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes Since many projects are using this mechanism for deprecating feature, it is sometimes difficult to understand which vendor triggers a deprecation. Sometimes we're using `since Symfony x.y` format, sometimes we are using `since x.y`. I propose to always use `since Symfony x.y` format. Commits ------- c2338cbd7a [2.7][DX] Use constant message contextualisation for deprecations
2 parents ee4a81b + 7c7d85f commit 44fc737

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Encoder/JsonDecode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function __construct($associative = false, $depth = 512)
4949
*/
5050
public function getLastError()
5151
{
52-
@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);
52+
@trigger_error('The '.__METHOD__.' method is deprecated since Symfony 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);
5353

5454
return $this->lastError;
5555
}

Encoder/JsonEncode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __construct($bitmask = 0)
3939
*/
4040
public function getLastError()
4141
{
42-
@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);
42+
@trigger_error('The '.__METHOD__.' method is deprecated since Symfony 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);
4343

4444
return $this->lastError;
4545
}

Encoder/JsonEncoder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function __construct(JsonEncode $encodingImpl = null, JsonDecode $decodin
3838
*/
3939
public function getLastEncodingError()
4040
{
41-
@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);
41+
@trigger_error('The '.__METHOD__.' method is deprecated since Symfony 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);
4242

4343
return $this->encodingImpl->getLastError();
4444
}
@@ -52,7 +52,7 @@ public function getLastEncodingError()
5252
*/
5353
public function getLastDecodingError()
5454
{
55-
@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);
55+
@trigger_error('The '.__METHOD__.' method is deprecated since Symfony 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);
5656

5757
return $this->decodingImpl->getLastError();
5858
}

0 commit comments

Comments
 (0)