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

Skip to content

Commit de43ff1

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: [Serializer] Fixup attributes import
2 parents 885e9c3 + b072fe9 commit de43ff1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

serializer.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,14 @@ You can also restrict the usage of a context to some groups::
241241
namespace App\Model;
242242

243243
use Symfony\Component\Serializer\Annotation\Context;
244+
use Symfony\Component\Serializer\Annotation\Groups;
244245
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
245246

246247
class Person
247248
{
248-
#[Serializer\Groups(['extended'])]
249-
#[Serializer\Context([DateTimeNormalizer::FORMAT_KEY => \DateTime::RFC3339])]
250-
#[Serializer\Context(
249+
#[Groups(['extended'])]
250+
#[Context([DateTimeNormalizer::FORMAT_KEY => \DateTime::RFC3339])]
251+
#[Context(
251252
context: [DateTimeNormalizer::FORMAT_KEY => \DateTime::RFC3339_EXTENDED],
252253
groups: ['extended'],
253254
)]

0 commit comments

Comments
 (0)