Skip to content

Commit 0a2ca3b

Browse files
committed
Merge branch '6.0' into 6.1
* 6.0: [Security] Update custom_authenticator fix(serializer): missing empty_array_as_object in example
2 parents dca2685 + 63b7af6 commit 0a2ca3b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

security/custom_authenticator.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ authenticator methods (e.g. ``createToken()``)::
355355
{
356356
// ...
357357

358-
public function authenticate(Request $request): PassportInterface
358+
public function authenticate(Request $request): Passport
359359
{
360360
// ... process the request
361361

@@ -367,7 +367,7 @@ authenticator methods (e.g. ``createToken()``)::
367367
return $passport;
368368
}
369369

370-
public function createToken(PassportInterface $passport, string $firewallName): TokenInterface
370+
public function createToken(Passport $passport, string $firewallName): TokenInterface
371371
{
372372
// read the attribute value
373373
return new CustomOauthToken($passport->getUser(), $passport->getAttribute('scope'));

serializer.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ resources. This context is passed to all normalizers. For example:
101101
* :class:`Symfony\\Component\\Serializer\\Normalizer\\DateTimeNormalizer` uses
102102
``datetime_format`` key as date time format;
103103
* :class:`Symfony\\Component\\Serializer\\Normalizer\\AbstractObjectNormalizer`
104-
uses ``empty_iterable_as_object`` to represent empty objects as ``{}`` instead
104+
uses ``preserve_empty_objects`` to represent empty objects as ``{}`` instead
105+
of ``[]`` in JSON.
106+
* :class:`Symfony\\Component\\Serializer\\Serializer`
107+
uses ``empty_array_as_object`` to represent empty arrays as ``{}`` instead
105108
of ``[]`` in JSON.
106109

107110
You can pass the context as follows::

0 commit comments

Comments
 (0)