Skip to content

Commit 5d0761f

Browse files
Merge branch '7.2' into 7.3
* 7.2: Fix-type-error-when-revealing-broken-secret fix compatibility with Relay 0.11 [Security] Handle non-callable implementations of `FirewallListenerInterface` [DomCrawler] Allow selecting `button`s by their `value` flip excluded properties with keys with Doctrine-style constraint config
2 parents d2d0118 + d6891a5 commit 5d0761f

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

Constraints/Cascade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public function __construct(array|string|null $exclude = null, ?array $options =
3636
trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class);
3737

3838
$options = array_merge($exclude, $options ?? []);
39+
$options['exclude'] = array_flip((array) ($options['exclude'] ?? []));
3940
} else {
4041
if (\is_array($options)) {
4142
trigger_deprecation('symfony/validator', '7.3', 'Passing an array of options to configure the "%s" constraint is deprecated, use named arguments instead.', static::class);

Tests/Constraints/CascadeTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,20 @@ public function testCascadeAttribute()
2727
self::assertTrue($loader->loadClassMetadata($metadata));
2828
self::assertSame(CascadingStrategy::CASCADE, $metadata->getCascadingStrategy());
2929
}
30+
31+
public function testExcludeProperties()
32+
{
33+
$constraint = new Cascade(['foo', 'bar']);
34+
35+
self::assertSame(['foo' => 0, 'bar' => 1], $constraint->exclude);
36+
}
37+
38+
public function testExcludePropertiesDoctrineStyle()
39+
{
40+
$constraint = new Cascade(['exclude' => ['foo', 'bar']]);
41+
42+
self::assertSame(['foo' => 0, 'bar' => 1], $constraint->exclude);
43+
}
3044
}
3145

3246
#[Cascade]

0 commit comments

Comments
 (0)