@@ -133,7 +133,6 @@ |
||
| 133 | 133 | * @param string $operationName |
| 134 | 134 | * @param array $operation |
| 135 | 135 | * @param string $resourceShortName |
| 136 | - * @param bool $collection |
|
| 137 | 136 | * |
| 138 | 137 | * @throws RuntimeException |
| 139 | 138 | */ |
@@ -37,7 +37,6 @@ |
||
| 37 | 37 | * @param ManagerRegistry $managerRegistry |
| 38 | 38 | * @param PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory |
| 39 | 39 | * @param PropertyMetadataFactoryInterface $propertyMetadataFactory |
| 40 | - * @param QueryItemExtensionInterface[] $itemExtensions |
|
| 41 | 40 | */ |
| 42 | 41 | public function __construct(ManagerRegistry $managerRegistry, PropertyNameCollectionFactoryInterface $propertyNameCollectionFactory, PropertyMetadataFactoryInterface $propertyMetadataFactory, array $collectionExtensions = []) |
| 43 | 42 | { |
@@ -19,7 +19,6 @@ |
||
| 19 | 19 | use ApiPlatform\Core\Metadata\Property\Factory\PropertyMetadataFactoryInterface; |
| 20 | 20 | use ApiPlatform\Core\Metadata\Property\Factory\PropertyNameCollectionFactoryInterface; |
| 21 | 21 | use Doctrine\Common\Persistence\ManagerRegistry; |
| 22 | -use Doctrine\ORM\EntityManagerInterface; |
|
| 23 | 22 | use Doctrine\ORM\Mapping\ClassMetadataInfo; |
| 24 | 23 | |
| 25 | 24 | /** |
@@ -117,13 +117,13 @@ |
||
| 117 | 117 | $queryBuilder->expr()->in('o', $previousQueryBuilder->getDQL()) |
| 118 | 118 | ); |
| 119 | 119 | |
| 120 | - foreach ($this->collectionExtensions as $extension) { |
|
| 121 | - $extension->applyToCollection($queryBuilder, $queryNameGenerator, $resourceClass, $operationName); |
|
| 120 | + foreach ($this->collectionExtensions as $extension) { |
|
| 121 | + $extension->applyToCollection($queryBuilder, $queryNameGenerator, $resourceClass, $operationName); |
|
| 122 | 122 | |
| 123 | - if ($extension instanceof QueryResultCollectionExtensionInterface && $extension->supportsResult($resourceClass, $operationName)) { |
|
| 124 | - return $extension->getResult($queryBuilder); |
|
| 125 | - } |
|
| 126 | - } |
|
| 123 | + if ($extension instanceof QueryResultCollectionExtensionInterface && $extension->supportsResult($resourceClass, $operationName)) { |
|
| 124 | + return $extension->getResult($queryBuilder); |
|
| 125 | + } |
|
| 126 | + } |
|
| 127 | 127 | |
| 128 | 128 | return $queryBuilder->getQuery()->getResult(); |
| 129 | 129 | } |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | */ |
| 66 | 66 | public function getResourceClassFromContext($value, array $context = null, bool $strict = false): string |
| 67 | 67 | { |
| 68 | - $resourceClass = $context['resource_class'] ?? null; |
|
| 68 | + $resourceClass = $context['resource_class'] ?? null; |
|
| 69 | 69 | |
| 70 | 70 | if (isset($context['subcollection_resource_class']) && null !== $context['subcollection_resource_class']) { |
| 71 | 71 | $resourceClass = $context['subcollection_resource_class']; |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - throw new RuntimeException('One of the following request attribute must be defined: '.implode(', ', array_map(function ($operationType) { |
|
| 64 | + throw new RuntimeException('One of the following request attribute must be defined: '.implode(', ', array_map(function($operationType) { |
|
| 65 | 65 | return "_api_{$operationType}_operation_name"; |
| 66 | 66 | }, OperationTypes::TYPES))); |
| 67 | 67 | } |