Skip to content

Commit 07bd710

Browse files
committed
Review
1 parent 58ee957 commit 07bd710

File tree

12 files changed

+62
-262
lines changed

12 files changed

+62
-262
lines changed

src/Hydra/State/JsonStreamerProcessor.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use ApiPlatform\Metadata\IriConverterInterface;
2323
use ApiPlatform\Metadata\Operation;
2424
use ApiPlatform\Metadata\Operation\Factory\OperationMetadataFactoryInterface;
25+
use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface;
2526
use ApiPlatform\Metadata\ResourceClassResolverInterface;
2627
use ApiPlatform\Metadata\UrlGeneratorInterface;
2728
use ApiPlatform\State\Pagination\PaginatorInterface;
@@ -54,13 +55,15 @@ public function __construct(
5455
?IriConverterInterface $iriConverter = null,
5556
?ResourceClassResolverInterface $resourceClassResolver = null,
5657
?OperationMetadataFactoryInterface $operationMetadataFactory = null,
58+
?ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory = null,
5759
private readonly string $pageParameterName = 'page',
5860
private readonly string $enabledParameterName = 'pagination',
5961
private readonly int $urlGenerationStrategy = UrlGeneratorInterface::ABS_PATH,
6062
) {
6163
$this->resourceClassResolver = $resourceClassResolver;
6264
$this->iriConverter = $iriConverter;
6365
$this->operationMetadataFactory = $operationMetadataFactory;
66+
$this->resourceMetadataCollectionFactory = $resourceMetadataCollectionFactory;
6467
}
6568

6669
public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = [])

src/Laravel/ApiPlatformProvider.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@
148148
use ApiPlatform\State\Pagination\Pagination;
149149
use ApiPlatform\State\Pagination\PaginationOptions;
150150
use ApiPlatform\State\Processor\AddLinkHeaderProcessor;
151-
use ApiPlatform\State\Processor\LinkedDataPlatformProcessor;
152151
use ApiPlatform\State\Processor\RespondProcessor;
153152
use ApiPlatform\State\Processor\SerializeProcessor;
154153
use ApiPlatform\State\Processor\WriteProcessor;
@@ -405,7 +404,13 @@ public function register(): void
405404
$this->app->bind(ProviderInterface::class, ContentNegotiationProvider::class);
406405

407406
$this->app->singleton(RespondProcessor::class, function (Application $app) {
408-
$decorated = new RespondProcessor();
407+
$decorated = new RespondProcessor(
408+
$app->make(IriConverterInterface::class),
409+
$app->make(ResourceClassResolverInterface::class),
410+
$app->make(OperationMetadataFactoryInterface::class),
411+
$app->make(ResourceMetadataCollectionFactoryInterface::class)
412+
);
413+
409414
if (class_exists(AddHeadersProcessor::class)) {
410415
/** @var ConfigRepository */
411416
$config = $app['config']->get('api-platform.http_cache') ?? [];
@@ -424,11 +429,7 @@ public function register(): void
424429

425430
$decorated = new AddLinkHeaderProcessor($decorated, new HttpHeaderSerializer());
426431

427-
return new LinkedDataPlatformProcessor(
428-
$decorated,
429-
$app->make(ResourceClassResolverInterface::class),
430-
$app->make(ResourceMetadataCollectionFactoryInterface::class)
431-
);
432+
return $decorated;
432433
});
433434

434435
$this->app->singleton(SerializeProcessor::class, function (Application $app) {

src/Serializer/State/JsonStreamerProcessor.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use ApiPlatform\Metadata\IriConverterInterface;
2020
use ApiPlatform\Metadata\Operation;
2121
use ApiPlatform\Metadata\Operation\Factory\OperationMetadataFactoryInterface;
22+
use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface;
2223
use ApiPlatform\Metadata\ResourceClassResolverInterface;
2324
use ApiPlatform\State\ProcessorInterface;
2425
use ApiPlatform\State\Util\HttpResponseHeadersTrait;
@@ -46,10 +47,12 @@ public function __construct(
4647
?IriConverterInterface $iriConverter = null,
4748
?ResourceClassResolverInterface $resourceClassResolver = null,
4849
?OperationMetadataFactoryInterface $operationMetadataFactory = null,
50+
?ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory = null,
4951
) {
5052
$this->resourceClassResolver = $resourceClassResolver;
5153
$this->iriConverter = $iriConverter;
5254
$this->operationMetadataFactory = $operationMetadataFactory;
55+
$this->resourceMetadataCollectionFactory = $resourceMetadataCollectionFactory;
5356
}
5457

5558
public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = [])

src/State/Processor/LinkedDataPlatformProcessor.php

Lines changed: 0 additions & 78 deletions
This file was deleted.

src/State/Processor/RespondProcessor.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use ApiPlatform\Metadata\IriConverterInterface;
1818
use ApiPlatform\Metadata\Operation;
1919
use ApiPlatform\Metadata\Operation\Factory\OperationMetadataFactoryInterface;
20+
use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface;
2021
use ApiPlatform\Metadata\ResourceClassResolverInterface;
2122
use ApiPlatform\State\ProcessorInterface;
2223
use ApiPlatform\State\StopwatchAwareInterface;
@@ -40,10 +41,12 @@ public function __construct(
4041
?IriConverterInterface $iriConverter = null,
4142
?ResourceClassResolverInterface $resourceClassResolver = null,
4243
?OperationMetadataFactoryInterface $operationMetadataFactory = null,
44+
?ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory = null,
4345
) {
4446
$this->iriConverter = $iriConverter;
4547
$this->resourceClassResolver = $resourceClassResolver;
4648
$this->operationMetadataFactory = $operationMetadataFactory;
49+
$this->resourceMetadataCollectionFactory = $resourceMetadataCollectionFactory;
4750
}
4851

4952
public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = [])

src/State/Tests/Processor/LinkedDataPlatformProcessorTest.php

Lines changed: 0 additions & 160 deletions
This file was deleted.

0 commit comments

Comments
 (0)