Skip to content

Commit c41ee0e

Browse files
committed
minor #11404 Added the $context argument to supports* methods (javiereguiluz)
This PR was merged into the 3.4 branch. Discussion ---------- Added the $context argument to supports* methods Fixes #7541. No need to explain it in details because anyone reading the serializer docs knows what the $context is. Also, no need for "versionadded" directive because it was introduced in Symfony 3.3. Commits ------- 6760dfc Added the $context argument to supports* methods
2 parents c23b469 + 6760dfc commit c41ee0e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

serializer/custom_encoders.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ create your own encoder that uses the
3232
return Yaml::dump($data);
3333
}
3434

35-
public function supportsEncoding($format)
35+
public function supportsEncoding($format, array $context = [])
3636
{
3737
return 'yaml' === $format;
3838
}
@@ -42,7 +42,7 @@ create your own encoder that uses the
4242
return Yaml::parse($data);
4343
}
4444

45-
public function supportsDecoding($format)
45+
public function supportsDecoding($format, array $context = [])
4646
{
4747
return 'yaml' === $format;
4848
}

serializer/custom_normalizer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ to customize the normalized data. To do that, leverage the ``ObjectNormalizer``:
4747
return $data;
4848
}
4949

50-
public function supportsNormalization($data, $format = null)
50+
public function supportsNormalization($data, $format = null, array $context = [])
5151
{
5252
return $data instanceof Topic;
5353
}

0 commit comments

Comments
 (0)