Skip to content

Commit b98908c

Browse files
committed
DataProvider & DataTransformer
1 parent 4a06b7c commit b98908c

File tree

50 files changed

+110
-96
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+110
-96
lines changed

phpstan.neon.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ parameters:
7272
path: src/Core/EventListener/AddFormatListener.php
7373
- '#Parameter \#1 \$vars of class GraphQL\\Language\\AST\\(IntValue|ObjectField|ObjectValue|BooleanValue|ListValue|StringValue)Node constructor expects array<bool\|float\|GraphQL\\Language\\AST\\Location\|GraphQL\\Language\\AST\\NameNode\|GraphQL\\Language\\AST\\NodeList\|GraphQL\\Language\\AST\\SelectionSetNode\|int\|string\|null>, array<string, .+> given\.#'
7474
- '#Parameter \#1 \$defaultContext of class Symfony\\Component\\Serializer\\Encoder\\Json(De|En)code constructor expects array, (int|true) given\.#'
75-
- '#Parameter \#(2|3) \$(resourceMetadataFactory|pagination) of class ApiPlatform\\Doctrine\\Orm\\Extension\\PaginationExtension constructor expects (ApiPlatform\\Core\\Metadata\\Resource\\Factory\\ResourceMetadataFactoryInterface\|Symfony\\Component\\HttpFoundation\\RequestStack|ApiPlatform\\Core\\DataProvider\\Pagination\|ApiPlatform\\Core\\Metadata\\Resource\\Factory\\ResourceMetadataFactoryInterface), stdClass given\.#'
75+
- '#Parameter \#(2|3) \$(resourceMetadataFactory|pagination) of class ApiPlatform\\Doctrine\\Orm\\Extension\\PaginationExtension constructor expects (ApiPlatform\\Core\\Metadata\\Resource\\Factory\\ResourceMetadataFactoryInterface\|Symfony\\Component\\HttpFoundation\\RequestStack|ApiPlatform\\Core\\Metadata\\Resource\\Factory\\ResourceMetadataFactoryInterface\|ApiPlatform\\State\\Pagination\\Pagination), stdClass given\.#'
7676
-
7777
message: '#Parameter \#[0-9] \$filterLocator of class .+ constructor expects ApiPlatform\\Core\\Api\\FilterCollection|Psr\\Container\\ContainerInterface, ArrayObject<mixed, mixed> given\.#'
7878
paths:

src/Core/Bridge/Elasticsearch/DataProvider/CollectionDataProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
use ApiPlatform\Core\Bridge\Elasticsearch\Api\IdentifierExtractorInterface;
1717
use ApiPlatform\Core\DataProvider\ContextAwareCollectionDataProviderInterface;
18-
use ApiPlatform\Core\DataProvider\Pagination;
1918
use ApiPlatform\Core\DataProvider\RestrictedDataProviderInterface;
2019
use ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface;
2120
use ApiPlatform\Elasticsearch\Exception\IndexNotFoundException;
@@ -24,6 +23,7 @@
2423
use ApiPlatform\Elasticsearch\Metadata\Document\Factory\DocumentMetadataFactoryInterface;
2524
use ApiPlatform\Exception\ResourceClassNotFoundException;
2625
use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface;
26+
use ApiPlatform\State\Pagination\Pagination;
2727
use Elasticsearch\Client;
2828
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
2929

src/Core/Bridge/Elasticsearch/DataProvider/SubresourceDataProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
namespace ApiPlatform\Core\Bridge\Elasticsearch\DataProvider;
1515

1616
use ApiPlatform\Core\Bridge\Elasticsearch\Api\IdentifierExtractorInterface;
17-
use ApiPlatform\Core\DataProvider\Pagination;
1817
use ApiPlatform\Core\DataProvider\RestrictedDataProviderInterface;
1918
use ApiPlatform\Core\DataProvider\SubresourceDataProviderInterface;
2019
use ApiPlatform\Core\Metadata\Property\Factory\PropertyMetadataFactoryInterface;
@@ -27,6 +26,7 @@
2726
use ApiPlatform\Exception\ResourceClassNotFoundException;
2827
use ApiPlatform\Exception\RuntimeException;
2928
use ApiPlatform\Metadata\ApiProperty;
29+
use ApiPlatform\State\Pagination\Pagination;
3030
use Elasticsearch\Client;
3131
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
3232

src/Core/Bridge/Symfony/Bundle/Resources/config/data_provider.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@
2727
</service>
2828
<service id="ApiPlatform\Core\DataProvider\SubresourceDataProviderInterface" alias="api_platform.subresource_data_provider" />
2929

30-
<service id="api_platform.pagination" class="ApiPlatform\Core\DataProvider\Pagination">
30+
<service id="api_platform.pagination" class="ApiPlatform\State\Pagination\Pagination">
3131
<argument type="service" id="api_platform.metadata.resource.metadata_collection_factory" />
3232
<argument>%api_platform.collection.pagination%</argument>
3333
<argument>%api_platform.graphql.collection.pagination%</argument>
3434
</service>
35-
<service id="ApiPlatform\Core\DataProvider\Pagination" alias="api_platform.pagination" />
35+
<service id="ApiPlatform\State\Pagination\Pagination" alias="api_platform.pagination" />
3636

37-
<service id="api_platform.pagination_options" class="ApiPlatform\Core\DataProvider\PaginationOptions">
37+
<service id="api_platform.pagination_options" class="ApiPlatform\State\Pagination\PaginationOptions">
3838
<argument>%api_platform.collection.pagination.enabled%</argument>
3939
<argument>%api_platform.collection.pagination.page_parameter_name%</argument>
4040
<argument>%api_platform.collection.pagination.client_items_per_page%</argument>
@@ -47,7 +47,7 @@
4747
<argument>%api_platform.collection.pagination.client_partial%</argument>
4848
<argument>%api_platform.collection.pagination.partial_parameter_name%</argument>
4949
</service>
50-
<service id="ApiPlatform\Core\DataProvider\PaginationOptions" alias="api_platform.pagination_options" />
50+
<service id="ApiPlatform\State\Pagination\PaginationOptions" alias="api_platform.pagination_options" />
5151
</services>
5252

5353
</container>

src/Core/GraphQl/Type/FieldsBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
namespace ApiPlatform\Core\GraphQl\Type;
1515

16-
use ApiPlatform\Core\DataProvider\Pagination;
1716
use ApiPlatform\Core\GraphQl\Resolver\Factory\ResolverFactoryInterface as ResolverFactoryLegacyInterface;
1817
use ApiPlatform\Core\GraphQl\Type\TypesContainerInterface as TypesContainerLegacyInterface;
1918
use ApiPlatform\Core\Metadata\Property\Factory\PropertyMetadataFactoryInterface;
@@ -24,6 +23,7 @@
2423
use ApiPlatform\GraphQl\Resolver\Factory\ResolverFactoryInterface;
2524
use ApiPlatform\GraphQl\Type\Definition\TypeInterface;
2625
use ApiPlatform\GraphQl\Type\TypesContainerInterface;
26+
use ApiPlatform\State\Pagination\Pagination;
2727
use ApiPlatform\Util\Inflector;
2828
use GraphQL\Type\Definition\InputObjectType;
2929
use GraphQL\Type\Definition\NullableType;

src/Core/GraphQl/Type/TypeBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313

1414
namespace ApiPlatform\Core\GraphQl\Type;
1515

16-
use ApiPlatform\Core\DataProvider\Pagination;
1716
use ApiPlatform\Core\GraphQl\Type\TypesContainerInterface as TypesContainerLegacyInterface;
1817
use ApiPlatform\Core\Metadata\Resource\ResourceMetadata;
1918
use ApiPlatform\GraphQl\Serializer\ItemNormalizer;
2019
use ApiPlatform\GraphQl\Type\TypesContainerInterface;
20+
use ApiPlatform\State\Pagination\Pagination;
2121
use GraphQL\Type\Definition\InputObjectType;
2222
use GraphQL\Type\Definition\InterfaceType;
2323
use GraphQL\Type\Definition\NonNull;

src/Core/Hydra/Serializer/CollectionNormalizer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
use ApiPlatform\Core\Api\OperationType;
1919
use ApiPlatform\Core\Api\ResourceClassResolverInterface;
2020
use ApiPlatform\Core\Api\UrlGeneratorInterface;
21-
use ApiPlatform\Core\DataProvider\PaginatorInterface;
22-
use ApiPlatform\Core\DataProvider\PartialPaginatorInterface;
2321
use ApiPlatform\Core\JsonLd\ContextBuilderInterface;
2422
use ApiPlatform\Core\JsonLd\Serializer\JsonLdContextTrait;
2523
use ApiPlatform\Core\Serializer\ContextTrait;
24+
use ApiPlatform\State\Pagination\PaginatorInterface;
25+
use ApiPlatform\State\Pagination\PartialPaginatorInterface;
2626
use Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface;
2727
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
2828
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;

src/Core/Hydra/Serializer/PartialCollectionViewNormalizer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313

1414
namespace ApiPlatform\Core\Hydra\Serializer;
1515

16-
use ApiPlatform\Core\DataProvider\PaginatorInterface;
17-
use ApiPlatform\Core\DataProvider\PartialPaginatorInterface;
1816
use ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface;
1917
use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface;
18+
use ApiPlatform\State\Pagination\PaginatorInterface;
19+
use ApiPlatform\State\Pagination\PartialPaginatorInterface;
2020
use ApiPlatform\Util\IriHelper;
2121
use Symfony\Component\PropertyAccess\PropertyAccess;
2222
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;

src/Core/OpenApi/Factory/OpenApiFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use ApiPlatform\Core\Api\FilterLocatorTrait;
1717
use ApiPlatform\Core\Api\IdentifiersExtractorInterface;
1818
use ApiPlatform\Core\Api\OperationType;
19-
use ApiPlatform\Core\DataProvider\PaginationOptions;
2019
use ApiPlatform\Core\JsonSchema\Schema;
2120
use ApiPlatform\Core\JsonSchema\SchemaFactoryInterface;
2221
use ApiPlatform\Core\JsonSchema\TypeFactoryInterface;
@@ -32,6 +31,7 @@
3231
use ApiPlatform\Core\OpenApi\Options;
3332
use ApiPlatform\Core\Operation\Factory\SubresourceOperationFactoryInterface;
3433
use ApiPlatform\Core\PathResolver\OperationPathResolverInterface;
34+
use ApiPlatform\State\Pagination\PaginationOptions;
3535
use Psr\Container\ContainerInterface;
3636
use Symfony\Component\PropertyInfo\Type;
3737

src/Core/Serializer/AbstractCollectionNormalizer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
namespace ApiPlatform\Core\Serializer;
1515

1616
use ApiPlatform\Core\Api\ResourceClassResolverInterface;
17-
use ApiPlatform\Core\DataProvider\PaginatorInterface;
18-
use ApiPlatform\Core\DataProvider\PartialPaginatorInterface;
1917
use ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface;
2018
use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface;
19+
use ApiPlatform\State\Pagination\PaginatorInterface;
20+
use ApiPlatform\State\Pagination\PartialPaginatorInterface;
2121
use Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface;
2222
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
2323
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;

0 commit comments

Comments
 (0)