From 6760dfc3216b5d74a4ca4b4f54a8b45ccf3668d8 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 11 Apr 2019 15:15:34 +0200 Subject: [PATCH] Added the $context argument to supports* methods --- serializer/custom_encoders.rst | 4 ++-- serializer/custom_normalizer.rst | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/serializer/custom_encoders.rst b/serializer/custom_encoders.rst index e3436c9cdec..3d5f7856a00 100644 --- a/serializer/custom_encoders.rst +++ b/serializer/custom_encoders.rst @@ -32,7 +32,7 @@ create your own encoder that uses the return Yaml::dump($data); } - public function supportsEncoding($format) + public function supportsEncoding($format, array $context = []) { return 'yaml' === $format; } @@ -42,7 +42,7 @@ create your own encoder that uses the return Yaml::parse($data); } - public function supportsDecoding($format) + public function supportsDecoding($format, array $context = []) { return 'yaml' === $format; } diff --git a/serializer/custom_normalizer.rst b/serializer/custom_normalizer.rst index b82b61e8e07..1794590c5c8 100644 --- a/serializer/custom_normalizer.rst +++ b/serializer/custom_normalizer.rst @@ -47,7 +47,7 @@ to customize the normalized data. To do that, leverage the ``ObjectNormalizer``: return $data; } - public function supportsNormalization($data, $format = null) + public function supportsNormalization($data, $format = null, array $context = []) { return $data instanceof Topic; }