diff --git a/src/Metadata/Resource/Factory/AlternateUriResourceMetadataCollectionFactory.php b/src/Metadata/Resource/Factory/AlternateUriResourceMetadataCollectionFactory.php deleted file mode 100644 index c64e36f4967..00000000000 --- a/src/Metadata/Resource/Factory/AlternateUriResourceMetadataCollectionFactory.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace ApiPlatform\Metadata\Resource\Factory; - -use ApiPlatform\Metadata\Resource\ResourceMetadataCollection; - -/** - * @author Antoine Bluchet - * - * @deprecated BC layer, is removed in 3.0 - */ -final class AlternateUriResourceMetadataCollectionFactory implements ResourceMetadataCollectionFactoryInterface -{ - public function __construct(private readonly ?ResourceMetadataCollectionFactoryInterface $decorated = null) - { - } - - /** - * {@inheritdoc} - */ - public function create(string $resourceClass): ResourceMetadataCollection - { - $resourceMetadataCollection = new ResourceMetadataCollection($resourceClass); - if ($this->decorated) { - $resourceMetadataCollection = $this->decorated->create($resourceClass); - } - - foreach ($resourceMetadataCollection as $i => $resource) { - if (0 === $i) { - continue; - } - - $resource = $resource->withExtraProperties($resource->getExtraProperties() + ['is_alternate_resource_metadata' => true]); - $operations = $resource->getOperations(); - foreach ($operations as $key => $operation) { - $operations->add($key, $operation->withExtraProperties($operation->getExtraProperties() + ['is_alternate_resource_metadata' => true])); - } - - $resourceMetadataCollection[$i] = $resource->withOperations($operations); - } - - return $resourceMetadataCollection; - } -} diff --git a/src/Symfony/Bundle/Resources/config/metadata/resource.xml b/src/Symfony/Bundle/Resources/config/metadata/resource.xml index 91d5d1a669a..93580976c1d 100644 --- a/src/Symfony/Bundle/Resources/config/metadata/resource.xml +++ b/src/Symfony/Bundle/Resources/config/metadata/resource.xml @@ -58,10 +58,6 @@ - - - - diff --git a/tests/Symfony/Bundle/DependencyInjection/ApiPlatformExtensionTest.php b/tests/Symfony/Bundle/DependencyInjection/ApiPlatformExtensionTest.php index cf89456b6af..2168d665426 100644 --- a/tests/Symfony/Bundle/DependencyInjection/ApiPlatformExtensionTest.php +++ b/tests/Symfony/Bundle/DependencyInjection/ApiPlatformExtensionTest.php @@ -369,7 +369,6 @@ public function testMetadataConfiguration(): void 'api_platform.metadata.resource.metadata_collection_factory.input_output', 'api_platform.metadata.resource.metadata_collection_factory.formats', 'api_platform.metadata.resource.metadata_collection_factory.filters', - 'api_platform.metadata.resource.metadata_collection_factory.alternate_uri', 'api_platform.metadata.resource.metadata_collection_factory.cached', 'api_platform.cache.metadata.resource_collection',