Skip to content

Commit 69b4d35

Browse files
authored
fix(state): provider as ParameterProviderInterface (#6430)
1 parent c7f25dc commit 69b4d35

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/Metadata/Parameter.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
namespace ApiPlatform\Metadata;
1515

1616
use ApiPlatform\OpenApi;
17-
use ApiPlatform\State\ProviderInterface;
17+
use ApiPlatform\State\ParameterProviderInterface;
1818
use Symfony\Component\Validator\Constraint;
1919

2020
/**
@@ -23,11 +23,11 @@
2323
abstract class Parameter
2424
{
2525
/**
26-
* @param array{type?: string}|null $schema
27-
* @param array<string, mixed> $extraProperties
28-
* @param ProviderInterface|callable|string|null $provider
29-
* @param FilterInterface|string|null $filter
30-
* @param Constraint|Constraint[]|null $constraints
26+
* @param array{type?: string}|null $schema
27+
* @param array<string, mixed> $extraProperties
28+
* @param ParameterProviderInterface|callable|string|null $provider
29+
* @param FilterInterface|string|null $filter
30+
* @param Constraint|Constraint[]|null $constraints
3131
*/
3232
public function __construct(
3333
protected ?string $key = null,
@@ -144,7 +144,7 @@ public function withOpenApi(OpenApi\Model\Parameter $openApi): static
144144
}
145145

146146
/**
147-
* @param ProviderInterface|string $provider
147+
* @param ParameterProviderInterface|string $provider
148148
*/
149149
public function withProvider(mixed $provider): static
150150
{

src/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php

+3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
use ApiPlatform\Metadata\Util\Inflector;
3939
use ApiPlatform\Problem\Serializer\ConstraintViolationListNormalizer;
4040
use ApiPlatform\State\ApiResource\Error;
41+
use ApiPlatform\State\ParameterProviderInterface;
4142
use ApiPlatform\State\ProcessorInterface;
4243
use ApiPlatform\State\ProviderInterface;
4344
use ApiPlatform\Symfony\EventListener\AddHeadersListener;
@@ -202,6 +203,8 @@ public function load(array $configs, ContainerBuilder $container): void
202203
->addTag('api_platform.state_processor');
203204
$container->registerForAutoconfiguration(UriVariableTransformerInterface::class)
204205
->addTag('api_platform.uri_variables.transformer');
206+
$container->registerForAutoconfiguration(ParameterProviderInterface::class)
207+
->addTag('api_platform.parameter_provider');
205208

206209
if (!$container->has('api_platform.state.item_provider')) {
207210
$container->setAlias('api_platform.state.item_provider', 'api_platform.state_provider.object');

0 commit comments

Comments
 (0)