Skip to content

Commit 3138985

Browse files
committed
chore(laravel): ValidateProvider wants normalizer
deprecate when its not the case
1 parent f211ff0 commit 3138985

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

State/ValidateProvider.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,13 @@ final class ValidateProvider implements ProviderInterface
3838
public function __construct(
3939
private readonly ProviderInterface $inner,
4040
private readonly Application $app,
41-
// TODO: trigger deprecation in API Platform 4.2 when this is not defined
4241
private readonly ?NormalizerInterface $normalizer = null,
4342
?NameConverterInterface $nameConverter = null,
4443
) {
44+
if (!$normalizer) {
45+
trigger_deprecation('api-platform/laravel', '4.2', 'Not using the normalizer in %s is deprecated.', self::class);
46+
}
47+
4548
$this->nameConverter = $nameConverter;
4649
}
4750

@@ -113,7 +116,6 @@ private function getBodyForValidation(mixed $body): array
113116
}
114117

115118
// hopefully this path never gets used, its there for BC-layer only
116-
// TODO: deprecation in API Platform 4.2
117119
// TODO: remove in 5.0
118120
if ($s = json_encode($body)) {
119121
return json_decode($s, true);

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,24 @@
3030
"php": ">=8.2",
3131
"api-platform/documentation": "^4.1.11",
3232
"api-platform/hydra": "^4.1.11",
33+
"api-platform/json-api": "^4.1.11",
3334
"api-platform/json-hal": "^4.1.11",
3435
"api-platform/json-schema": "^4.1.11",
3536
"api-platform/jsonld": "^4.1.11",
36-
"api-platform/json-api": "^4.1.11",
3737
"api-platform/metadata": "^4.1.11",
3838
"api-platform/openapi": "^4.1.11",
3939
"api-platform/serializer": "^4.1.11",
4040
"api-platform/state": "^4.1.11",
4141
"illuminate/config": "^11.0 || ^12.0",
42-
"laravel/framework": "^11.0 || ^12.0",
42+
"illuminate/container": "^11.0 || ^12.0",
4343
"illuminate/contracts": "^11.0 || ^12.0",
4444
"illuminate/database": "^11.0 || ^12.0",
4545
"illuminate/http": "^11.0 || ^12.0",
4646
"illuminate/pagination": "^11.0 || ^12.0",
4747
"illuminate/routing": "^11.0 || ^12.0",
4848
"illuminate/support": "^11.0 || ^12.0",
49-
"illuminate/container": "^11.0 || ^12.0",
49+
"laravel/framework": "^11.0 || ^12.0",
50+
"symfony/deprecation-contracts": "^3.6",
5051
"symfony/type-info": "^7.2",
5152
"symfony/web-link": "^6.4 || ^7.1",
5253
"willdurand/negotiation": "^3.1"

0 commit comments

Comments
 (0)