Skip to content

Commit 1105bc3

Browse files
committed
Bridge/Doctrine
1 parent ab7ca2d commit 1105bc3

File tree

195 files changed

+697
-608
lines changed

Some content is hidden

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

195 files changed

+697
-608
lines changed

phpstan.neon.dist

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ parameters:
5757
-
5858
message: "#Parameter \\#2 \\$dqlPart of method Doctrine\\\\ORM\\\\QueryBuilder::add\\(\\) expects array<'join'\\|int, array<int\\|string, object>\\|string>\\|object\\|string, array\\('o' => Doctrine\\\\ORM\\\\Query\\\\Expr\\\\Join\\) given\\.#"
5959
paths:
60-
- tests/Core/Bridge/Doctrine/Orm/Extension/FilterEagerLoadingExtensionTest.php
60+
- tests/Doctrine/Orm/Extension/FilterEagerLoadingExtensionTest.php
6161
-
6262
message: '#Strict comparison using !== between .+ and .+ will always evaluate to false\.#'
6363
paths:
64-
- src/Core/Bridge/Doctrine/Common/PropertyHelperTrait.php
64+
- src/Doctrine/Common/PropertyHelperTrait.php
6565
- '#Access to an undefined property Prophecy\\Prophecy\\ObjectProphecy<(\\?[a-zA-Z0-9_]+)+>::\$[a-zA-Z0-9_]+#'
6666
-
6767
message: '#Call to an undefined method Doctrine\\Persistence\\ObjectManager::getConnection\(\)#'
@@ -72,11 +72,11 @@ 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\\Core\\Bridge\\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\\DataProvider\\Pagination\|ApiPlatform\\Core\\Metadata\\Resource\\Factory\\ResourceMetadataFactoryInterface), 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:
79-
- tests/Core/Bridge/Doctrine/Orm/Extension/FilterExtensionTest.php
79+
- tests/Doctrine/Orm/Extension/FilterExtensionTest.php
8080
- tests/Core/Hydra/Serializer/CollectionFiltersNormalizerTest.php
8181
- tests/Core/Swagger/Serializer/DocumentationNormalizerV2Test.php
8282
- tests/Core/Swagger/Serializer/DocumentationNormalizerV3Test.php
@@ -107,9 +107,9 @@ parameters:
107107
- '#Constructor of class ApiPlatform\\Core\\Annotation\\ApiProperty has an unused parameter#'
108108

109109
# Expected, due to optional interfaces
110-
- '#Method ApiPlatform\\Core\\Bridge\\Doctrine\\Orm\\Extension\\QueryCollectionExtensionInterface::applyToCollection\(\) invoked with 5 parameters, 3-4 required\.#'
111-
- '#Method ApiPlatform\\Core\\Bridge\\Doctrine\\Orm\\Extension\\QueryResult(Item|Collection)ExtensionInterface::getResult\(\) invoked with 4 parameters, 1 required\.#'
112-
- '#Method ApiPlatform\\Core\\Bridge\\Doctrine\\Orm\\Extension\\QueryResult(Item|Collection)ExtensionInterface::supportsResult\(\) invoked with 3 parameters, 1-2 required\.#'
110+
- '#Method ApiPlatform\\Doctrine\\Orm\\Extension\\QueryCollectionExtensionInterface::applyToCollection\(\) invoked with 5 parameters, 3-4 required\.#'
111+
- '#Method ApiPlatform\\\Doctrine\\Orm\\Extension\\QueryResult(Item|Collection)ExtensionInterface::getResult\(\) invoked with 4 parameters, 1 required\.#'
112+
- '#Method ApiPlatform\\Doctrine\\Orm\\Extension\\QueryResult(Item|Collection)ExtensionInterface::supportsResult\(\) invoked with 3 parameters, 1-2 required\.#'
113113
- '#Method ApiPlatform\\Core\\Bridge\\Symfony\\Routing\\RouteNameResolverInterface::getRouteName\(\) invoked with 3 parameters, 2 required\.#'
114114
- '#Method ApiPlatform\\Core\\DataPersister\\DataPersisterInterface::persist\(\) invoked with 2 parameters, 1 required\.#'
115115
- '#Method ApiPlatform\\Core\\DataPersister\\DataPersisterInterface::remove\(\) invoked with 2 parameters, 1 required\.#'
@@ -120,8 +120,8 @@ parameters:
120120
- '#Method Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface::supportsNormalization\(\) invoked with 3 parameters, 1-2 required\.#'
121121

122122
# Expected, due to deprecations
123-
- '#Method ApiPlatform\\Core\\Bridge\\Doctrine\\Orm\\Filter\\(Abstract|Exists|Order)Filter::filterProperty\(\) invoked with 7 parameters, 5-6 required\.#'
124-
- '#Method ApiPlatform\\Core\\Bridge\\Doctrine\\Orm\\Filter\\(AbstractFilter|FilterInterface)::apply\(\) invoked with 5 parameters, 3-4 required\.#'
123+
- '#Method ApiPlatform\\Doctrine\\Orm\\Filter\\(Abstract|Exists|Order)Filter::filterProperty\(\) invoked with 7 parameters, 5-6 required\.#'
124+
- '#Method ApiPlatform\\Doctrine\\Orm\\Filter\\(AbstractFilter|FilterInterface)::apply\(\) invoked with 5 parameters, 3-4 required\.#'
125125
- '#Method ApiPlatform\\Core\\PathResolver\\OperationPathResolverInterface::resolveOperationPath\(\) invoked with 4 parameters, 3 required\.#'
126126

127127
# Expected, due to backward compatibility

src/Core/Bridge/Doctrine/MongoDbOdm/CollectionDataProvider.php

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

1414
namespace ApiPlatform\Core\Bridge\Doctrine\MongoDbOdm;
1515

16-
use ApiPlatform\Core\Bridge\Doctrine\MongoDbOdm\Extension\AggregationCollectionExtensionInterface;
17-
use ApiPlatform\Core\Bridge\Doctrine\MongoDbOdm\Extension\AggregationResultCollectionExtensionInterface;
1816
use ApiPlatform\Core\DataProvider\CollectionDataProviderInterface;
1917
use ApiPlatform\Core\DataProvider\RestrictedDataProviderInterface;
18+
use ApiPlatform\Doctrine\Odm\Extension\AggregationCollectionExtensionInterface;
19+
use ApiPlatform\Doctrine\Odm\Extension\AggregationResultCollectionExtensionInterface;
2020
use ApiPlatform\Exception\OperationNotFoundException;
2121
use ApiPlatform\Exception\RuntimeException;
2222
use Doctrine\ODM\MongoDB\DocumentManager;

src/Core/Bridge/Doctrine/MongoDbOdm/ItemDataProvider.php

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

1616
use ApiPlatform\Core\Bridge\Doctrine\Common\Util\IdentifierManagerTrait;
17-
use ApiPlatform\Core\Bridge\Doctrine\MongoDbOdm\Extension\AggregationItemExtensionInterface;
18-
use ApiPlatform\Core\Bridge\Doctrine\MongoDbOdm\Extension\AggregationResultItemExtensionInterface;
1917
use ApiPlatform\Core\DataProvider\DenormalizedIdentifiersAwareItemDataProviderInterface;
2018
use ApiPlatform\Core\DataProvider\RestrictedDataProviderInterface;
2119
use ApiPlatform\Core\Identifier\IdentifierConverterInterface;
2220
use ApiPlatform\Core\Metadata\Property\Factory\PropertyMetadataFactoryInterface;
2321
use ApiPlatform\Core\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface;
2422
use ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface;
23+
use ApiPlatform\Doctrine\Odm\Extension\AggregationItemExtensionInterface;
24+
use ApiPlatform\Doctrine\Odm\Extension\AggregationResultItemExtensionInterface;
2525
use ApiPlatform\Exception\RuntimeException;
2626
use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface;
2727
use ApiPlatform\Metadata\Resource\ResourceMetadataCollection;

src/Core/Bridge/Doctrine/MongoDbOdm/SubresourceDataProvider.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
namespace ApiPlatform\Core\Bridge\Doctrine\MongoDbOdm;
1515

1616
use ApiPlatform\Core\Bridge\Doctrine\Common\Util\IdentifierManagerTrait;
17-
use ApiPlatform\Core\Bridge\Doctrine\MongoDbOdm\Extension\AggregationCollectionExtensionInterface;
18-
use ApiPlatform\Core\Bridge\Doctrine\MongoDbOdm\Extension\AggregationItemExtensionInterface;
19-
use ApiPlatform\Core\Bridge\Doctrine\MongoDbOdm\Extension\AggregationResultCollectionExtensionInterface;
20-
use ApiPlatform\Core\Bridge\Doctrine\MongoDbOdm\Extension\AggregationResultItemExtensionInterface;
2117
use ApiPlatform\Core\DataProvider\SubresourceDataProviderInterface;
2218
use ApiPlatform\Core\Identifier\IdentifierConverterInterface;
2319
use ApiPlatform\Core\Metadata\Property\Factory\PropertyMetadataFactoryInterface;
2420
use ApiPlatform\Core\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface;
2521
use ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface;
22+
use ApiPlatform\Doctrine\Odm\Extension\AggregationCollectionExtensionInterface;
23+
use ApiPlatform\Doctrine\Odm\Extension\AggregationItemExtensionInterface;
24+
use ApiPlatform\Doctrine\Odm\Extension\AggregationResultCollectionExtensionInterface;
25+
use ApiPlatform\Doctrine\Odm\Extension\AggregationResultItemExtensionInterface;
2626
use ApiPlatform\Exception\OperationNotFoundException;
2727
use ApiPlatform\Exception\ResourceClassNotSupportedException;
2828
use ApiPlatform\Exception\RuntimeException;

src/Core/Bridge/Doctrine/Orm/CollectionDataProvider.php

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

1414
namespace ApiPlatform\Core\Bridge\Doctrine\Orm;
1515

16-
use ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\QueryCollectionExtensionInterface;
17-
use ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\QueryResultCollectionExtensionInterface;
18-
use ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGenerator;
1916
use ApiPlatform\Core\DataProvider\ContextAwareCollectionDataProviderInterface;
2017
use ApiPlatform\Core\DataProvider\RestrictedDataProviderInterface;
18+
use ApiPlatform\Doctrine\Orm\Extension\QueryCollectionExtensionInterface;
19+
use ApiPlatform\Doctrine\Orm\Extension\QueryResultCollectionExtensionInterface;
20+
use ApiPlatform\Doctrine\Orm\Util\QueryNameGenerator;
2121
use ApiPlatform\Exception\RuntimeException;
2222
use Doctrine\ORM\EntityManagerInterface;
2323
use Doctrine\Persistence\ManagerRegistry;

src/Core/Bridge/Doctrine/Orm/ItemDataProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
namespace ApiPlatform\Core\Bridge\Doctrine\Orm;
1515

1616
use ApiPlatform\Core\Bridge\Doctrine\Common\Util\IdentifierManagerTrait;
17-
use ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\QueryItemExtensionInterface;
18-
use ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\QueryResultItemExtensionInterface;
19-
use ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGenerator;
2017
use ApiPlatform\Core\DataProvider\DenormalizedIdentifiersAwareItemDataProviderInterface;
2118
use ApiPlatform\Core\DataProvider\RestrictedDataProviderInterface;
2219
use ApiPlatform\Core\Identifier\IdentifierConverterInterface;
2320
use ApiPlatform\Core\Metadata\Property\Factory\PropertyMetadataFactoryInterface;
2421
use ApiPlatform\Core\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface;
2522
use ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface;
23+
use ApiPlatform\Doctrine\Orm\Extension\QueryItemExtensionInterface;
24+
use ApiPlatform\Doctrine\Orm\Extension\QueryResultItemExtensionInterface;
25+
use ApiPlatform\Doctrine\Orm\Util\QueryNameGenerator;
2626
use ApiPlatform\Exception\RuntimeException;
2727
use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface;
2828
use Doctrine\ORM\EntityManagerInterface;

src/Core/Bridge/Doctrine/Orm/SubresourceDataProvider.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@
1414
namespace ApiPlatform\Core\Bridge\Doctrine\Orm;
1515

1616
use ApiPlatform\Core\Bridge\Doctrine\Common\Util\IdentifierManagerTrait;
17-
use ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\FilterEagerLoadingExtension;
18-
use ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\QueryCollectionExtensionInterface;
19-
use ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\QueryItemExtensionInterface;
20-
use ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\QueryResultCollectionExtensionInterface;
21-
use ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\QueryResultItemExtensionInterface;
22-
use ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGenerator;
2317
use ApiPlatform\Core\DataProvider\SubresourceDataProviderInterface;
2418
use ApiPlatform\Core\Identifier\IdentifierConverterInterface;
2519
use ApiPlatform\Core\Metadata\Property\Factory\PropertyMetadataFactoryInterface;
2620
use ApiPlatform\Core\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface;
21+
use ApiPlatform\Doctrine\Orm\Extension\FilterEagerLoadingExtension;
22+
use ApiPlatform\Doctrine\Orm\Extension\QueryCollectionExtensionInterface;
23+
use ApiPlatform\Doctrine\Orm\Extension\QueryItemExtensionInterface;
24+
use ApiPlatform\Doctrine\Orm\Extension\QueryResultCollectionExtensionInterface;
25+
use ApiPlatform\Doctrine\Orm\Extension\QueryResultItemExtensionInterface;
26+
use ApiPlatform\Doctrine\Orm\Util\QueryNameGenerator;
2727
use ApiPlatform\Exception\ResourceClassNotSupportedException;
2828
use ApiPlatform\Exception\RuntimeException;
2929
use Doctrine\ORM\EntityManagerInterface;

src/Core/Bridge/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,6 @@
1616
use ApiPlatform\Core\Annotation\ApiResource;
1717
use ApiPlatform\Core\Api\FilterInterface;
1818
use ApiPlatform\Core\Api\UrlGeneratorInterface;
19-
use ApiPlatform\Core\Bridge\Doctrine\MongoDbOdm\Extension\AggregationCollectionExtensionInterface;
20-
use ApiPlatform\Core\Bridge\Doctrine\MongoDbOdm\Extension\AggregationItemExtensionInterface;
21-
use ApiPlatform\Core\Bridge\Doctrine\MongoDbOdm\Filter\AbstractFilter as DoctrineMongoDbOdmAbstractFilter;
22-
use ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\EagerLoadingExtension;
23-
use ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\FilterEagerLoadingExtension;
24-
use ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\QueryCollectionExtensionInterface as DoctrineQueryCollectionExtensionInterface;
25-
use ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\QueryItemExtensionInterface;
26-
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\AbstractContextAwareFilter as DoctrineOrmAbstractContextAwareFilter;
2719
use ApiPlatform\Core\Bridge\Elasticsearch\DataProvider\Extension\RequestBodySearchCollectionExtensionInterface;
2820
use ApiPlatform\Core\Bridge\Symfony\Validator\Metadata\Property\Restriction\PropertySchemaRestrictionMetadataInterface;
2921
use ApiPlatform\Core\Bridge\Symfony\Validator\ValidationGroupsGeneratorInterface;
@@ -35,6 +27,14 @@
3527
use ApiPlatform\Core\Metadata\Extractor\YamlExtractor;
3628
use ApiPlatform\DataTransformer\DataTransformerInitializerInterface;
3729
use ApiPlatform\DataTransformer\DataTransformerInterface;
30+
use ApiPlatform\Doctrine\Odm\Extension\AggregationCollectionExtensionInterface;
31+
use ApiPlatform\Doctrine\Odm\Extension\AggregationItemExtensionInterface;
32+
use ApiPlatform\Doctrine\Odm\Filter\AbstractFilter as DoctrineMongoDbOdmAbstractFilter;
33+
use ApiPlatform\Doctrine\Orm\Extension\EagerLoadingExtension;
34+
use ApiPlatform\Doctrine\Orm\Extension\FilterEagerLoadingExtension;
35+
use ApiPlatform\Doctrine\Orm\Extension\QueryCollectionExtensionInterface as DoctrineQueryCollectionExtensionInterface;
36+
use ApiPlatform\Doctrine\Orm\Extension\QueryItemExtensionInterface;
37+
use ApiPlatform\Doctrine\Orm\Filter\AbstractContextAwareFilter as DoctrineOrmAbstractContextAwareFilter;
3838
use ApiPlatform\GraphQl\Error\ErrorHandlerInterface;
3939
use ApiPlatform\GraphQl\Resolver\MutationResolverInterface;
4040
use ApiPlatform\GraphQl\Resolver\QueryCollectionResolverInterface;

src/Core/Bridge/Symfony/Bundle/DependencyInjection/Configuration.php

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

1414
namespace ApiPlatform\Core\Bridge\Symfony\Bundle\DependencyInjection;
1515

16-
use ApiPlatform\Bridge\Doctrine\Common\Filter\OrderFilterInterface;
1716
use ApiPlatform\Core\Annotation\ApiResource;
1817
use ApiPlatform\Core\Bridge\Elasticsearch\Metadata\Document\DocumentMetadata;
18+
use ApiPlatform\Doctrine\Common\Filter\OrderFilterInterface;
1919
use ApiPlatform\Exception\FilterValidationException;
2020
use ApiPlatform\Exception\InvalidArgumentException;
2121
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;

0 commit comments

Comments
 (0)