Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dbab662

Browse filesBrowse files
Merge branch '5.4' into 6.0
* 5.4: [Ldap] remove needless code Drop irrelevant UPGRADE note cs fix [Security] Add a little explanations in supports() description [Serializer] Rename Serializer::EMPTY_ARRAYS_AS_OBJECT to EMPTY_ARRAY_AS_OBJECT
2 parents 033db6e + 76a414c commit dbab662
Copy full SHA for dbab662

File tree

5 files changed

+10
-17
lines changed
Filter options

5 files changed

+10
-17
lines changed

‎UPGRADE-5.4.md

Copy file name to clipboardExpand all lines: UPGRADE-5.4.md
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ Security
6161

6262
* Deprecate the `$authManager` argument of `AccessListener`
6363
* Deprecate the `$authenticationManager` argument of the `AuthorizationChecker` constructor
64-
* Deprecate not setting `$authenticatorManagerEnabled` to `true` in `SecurityDataCollector` and `DebugFirewallCommand`
65-
(this is the default behavior when using `enable_authenticator_manager: true`)
6664
* Deprecate setting the `$alwaysAuthenticate` argument to `true` and not setting the
6765
`$exceptionOnNoToken argument to `false` of `AuthorizationChecker` (this is the default
6866
behavior when using `enable_authenticator_manager: true`)

‎src/Symfony/Component/Ldap/Ldap.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Ldap/Ldap.php
+4-9Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Symfony\Component\Ldap\Adapter\AdapterInterface;
1515
use Symfony\Component\Ldap\Adapter\EntryManagerInterface;
16+
use Symfony\Component\Ldap\Adapter\ExtLdap\Adapter;
1617
use Symfony\Component\Ldap\Adapter\QueryInterface;
1718
use Symfony\Component\Ldap\Exception\DriverNotFoundException;
1819

@@ -23,10 +24,6 @@ final class Ldap implements LdapInterface
2324
{
2425
private $adapter;
2526

26-
private const ADAPTER_MAP = [
27-
'ext_ldap' => 'Symfony\Component\Ldap\Adapter\ExtLdap\Adapter',
28-
];
29-
3027
public function __construct(AdapterInterface $adapter)
3128
{
3229
$this->adapter = $adapter;
@@ -74,12 +71,10 @@ public function escape(string $subject, string $ignore = '', int $flags = 0): st
7471
*/
7572
public static function create(string $adapter, array $config = []): self
7673
{
77-
if (!isset(self::ADAPTER_MAP[$adapter])) {
78-
throw new DriverNotFoundException(sprintf('Adapter "%s" not found. You should use one of: "%s".', $adapter, implode('", "', self::ADAPTER_MAP)));
74+
if ('ext_ldap' !== $adapter) {
75+
throw new DriverNotFoundException(sprintf('Adapter "%s" not found. Only "ext_ldap" is supported at the moment.', $adapter));
7976
}
8077

81-
$class = self::ADAPTER_MAP[$adapter];
82-
83-
return new self(new $class($config));
78+
return new self(new Adapter($config));
8479
}
8580
}

‎src/Symfony/Component/Security/Http/Authenticator/AuthenticatorInterface.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Http/Authenticator/AuthenticatorInterface.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ interface AuthenticatorInterface
3434
/**
3535
* Does the authenticator support the given Request?
3636
*
37-
* If this returns false, the authenticator will be skipped.
37+
* If this returns true, authenticate() will be called. If false, the authenticator will be skipped.
3838
*
3939
* Returning null means authenticate() can be called lazily when accessing the token storage.
4040
*/

‎src/Symfony/Component/Serializer/Serializer.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Serializer/Serializer.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ class Serializer implements SerializerInterface, ContextAwareNormalizerInterface
4949
{
5050
/**
5151
* Flag to control whether an empty array should be transformed to an
52-
* object (in JSON: {}) or to a map (in JSON: []).
52+
* object (in JSON: {}) or to a list (in JSON: []).
5353
*/
54-
public const EMPTY_ARRAYS_AS_OBJECT = 'empty_arrays_as_object';
54+
public const EMPTY_ARRAY_AS_OBJECT = 'empty_array_as_object';
5555

5656
private const SCALAR_TYPES = [
5757
'int' => true,
@@ -169,7 +169,7 @@ public function normalize(mixed $data, string $format = null, array $context = [
169169
switch (true) {
170170
case ($context[AbstractObjectNormalizer::PRESERVE_EMPTY_OBJECTS] ?? false) && \is_object($data):
171171
return $data;
172-
case ($context[self::EMPTY_ARRAYS_AS_OBJECT] ?? false) && \is_array($data):
172+
case ($context[self::EMPTY_ARRAY_AS_OBJECT] ?? false) && \is_array($data):
173173
return new \ArrayObject();
174174
}
175175
}

‎src/Symfony/Component/Serializer/Tests/SerializerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Serializer/Tests/SerializerTest.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ public function testNormalizeEmptyArrayAsObject(Serializer $serializer, array $d
592592
{
593593
$expected = '{"a1":[],"a2":{"k":"v"},"b1":{},"b2":{"k":"v"},"c1":{"nested":[]},"c2":{"nested":{"k":"v"}},"d1":{"nested":{}},"d2":{"nested":{"k":"v"}},"e1":{"map":{}},"e2":{"map":{"k":"v"}},"f1":{"map":[]},"f2":{"map":{"k":"v"}},"g1":{"list":[],"settings":{}},"g2":{"list":["greg"],"settings":{}}}';
594594
$this->assertSame($expected, $serializer->serialize($data, 'json', [
595-
Serializer::EMPTY_ARRAYS_AS_OBJECT => true,
595+
Serializer::EMPTY_ARRAY_AS_OBJECT => true,
596596
]));
597597
}
598598

@@ -601,7 +601,7 @@ public function testNormalizeEmptyArrayAsObjectAndPreserveEmptyArrayObject(Seria
601601
{
602602
$expected = '{"a1":{},"a2":{"k":"v"},"b1":{},"b2":{"k":"v"},"c1":{"nested":{}},"c2":{"nested":{"k":"v"}},"d1":{"nested":{}},"d2":{"nested":{"k":"v"}},"e1":{"map":{}},"e2":{"map":{"k":"v"}},"f1":{"map":{}},"f2":{"map":{"k":"v"}},"g1":{"list":{"list":[]},"settings":{}},"g2":{"list":["greg"],"settings":{}}}';
603603
$this->assertSame($expected, $serializer->serialize($data, 'json', [
604-
Serializer::EMPTY_ARRAYS_AS_OBJECT => true,
604+
Serializer::EMPTY_ARRAY_AS_OBJECT => true,
605605
AbstractObjectNormalizer::PRESERVE_EMPTY_OBJECTS => true,
606606
]));
607607
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.