Skip to content

Commit 8dba7c8

Browse files
MatTheCatnicolas-grekas
authored andcommitted
[HttpKernel] Introduce pinnable value resolvers with #[ValueResolver] and #[AsPinnedValueResolver]
1 parent fb62afc commit 8dba7c8

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Attribute/MapEntity.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@
1111

1212
namespace Symfony\Bridge\Doctrine\Attribute;
1313

14+
use Symfony\Bridge\Doctrine\ArgumentResolver\EntityValueResolver;
15+
use Symfony\Component\HttpKernel\Attribute\ValueResolver;
16+
1417
/**
1518
* Indicates that a controller argument should receive an Entity.
1619
*/
1720
#[\Attribute(\Attribute::TARGET_PARAMETER)]
18-
class MapEntity
21+
class MapEntity extends ValueResolver
1922
{
2023
public function __construct(
2124
public ?string $class = null,
@@ -26,8 +29,10 @@ public function __construct(
2629
public ?bool $stripNull = null,
2730
public array|string|null $id = null,
2831
public ?bool $evictCache = null,
29-
public bool $disabled = false,
32+
bool $disabled = false,
33+
string $resolver = EntityValueResolver::class,
3034
) {
35+
parent::__construct($resolver, $disabled);
3136
}
3237

3338
public function withDefaults(self $defaults, ?string $class): static

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"symfony/config": "^5.4|^6.0",
3131
"symfony/dependency-injection": "^6.2",
3232
"symfony/form": "^5.4.21|^6.2.7",
33-
"symfony/http-kernel": "^6.2",
33+
"symfony/http-kernel": "^6.3",
3434
"symfony/messenger": "^5.4|^6.0",
3535
"symfony/doctrine-messenger": "^5.4|^6.0",
3636
"symfony/property-access": "^5.4|^6.0",

0 commit comments

Comments
 (0)