Skip to content

Commit 63040a0

Browse files
fix: remove collection_operation_name legacy key
1 parent 7cbff73 commit 63040a0

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/Doctrine/Orm/Extension/PaginationExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ private function shouldDoctrinePaginatorFetchJoinCollection(QueryBuilder $queryB
134134
{
135135
$fetchJoinCollection = $operation?->getPaginationFetchJoinCollection();
136136

137-
if ((isset($context['collection_operation_name']) || isset($context['operation_name'])) && isset($fetchJoinCollection)) {
137+
if (isset($context['operation_name']) && isset($fetchJoinCollection)) {
138138
return $fetchJoinCollection;
139139
}
140140

@@ -167,7 +167,7 @@ private function shouldDoctrinePaginatorUseOutputWalkers(QueryBuilder $queryBuil
167167
{
168168
$useOutputWalkers = $operation?->getPaginationUseOutputWalkers();
169169

170-
if ((isset($context['collection_operation_name']) || isset($context['operation_name'])) && isset($useOutputWalkers)) {
170+
if (isset($context['operation_name']) && isset($useOutputWalkers)) {
171171
return $useOutputWalkers;
172172
}
173173

tests/Doctrine/Orm/Extension/PaginationExtensionTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,8 @@ public function testGetResultWithFetchJoinCollection(bool $paginationFetchJoinCo
398398
public function fetchJoinCollectionProvider(): array
399399
{
400400
return [
401-
'collection disabled' => [false, ['collection_operation_name' => 'get'], false],
402-
'collection enabled' => [true, ['collection_operation_name' => 'get'], true],
401+
'collection disabled' => [false, ['operation_name' => 'get'], false],
402+
'collection enabled' => [true, ['operation_name' => 'get'], true],
403403
'graphql disabled' => [false, ['graphql_operation_name' => 'query'], false],
404404
'graphql enabled' => [true, ['graphql_operation_name' => 'query'], true],
405405
];
@@ -448,8 +448,8 @@ public function testGetResultWithUseOutputWalkers(bool $paginationUseOutputWalke
448448
public function fetchUseOutputWalkersProvider(): array
449449
{
450450
return [
451-
'collection disabled' => [false, ['collection_operation_name' => 'get'], false],
452-
'collection enabled' => [true, ['collection_operation_name' => 'get'], true],
451+
'collection disabled' => [false, ['operation_name' => 'get'], false],
452+
'collection enabled' => [true, ['operation_name' => 'get'], true],
453453
'graphql disabled' => [false, ['graphql_operation_name' => 'query'], false],
454454
'graphql enabled' => [true, ['graphql_operation_name' => 'query'], true],
455455
];

tests/Symfony/EventListener/SerializeListenerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function testDoNotSerializeWhenDisabledInOperationAttribute()
116116

117117
public function testSerializeCollectionOperation()
118118
{
119-
$expectedContext = ['request_uri' => '', 'resource_class' => 'Foo', 'collection_operation_name' => 'get'];
119+
$expectedContext = ['request_uri' => '', 'resource_class' => 'Foo', 'operation_name' => 'get'];
120120
$serializerProphecy = $this->prophesize(SerializerInterface::class);
121121

122122
$serializerProphecy
@@ -129,7 +129,7 @@ public function testSerializeCollectionOperation()
129129
}),
130130
Argument::withEntry('request_uri', ''),
131131
Argument::withEntry('resource_class', 'Foo'),
132-
Argument::withEntry('collection_operation_name', 'get')
132+
Argument::withEntry('operation_name', 'get')
133133
)
134134
)
135135
->willReturn('bar')
@@ -155,7 +155,7 @@ public function testSerializeCollectionOperation()
155155

156156
public function testSerializeCollectionOperationWithOutputClassDisabled()
157157
{
158-
$expectedContext = ['request_uri' => '', 'resource_class' => 'Foo', 'collection_operation_name' => 'post', 'output' => ['class' => null]];
158+
$expectedContext = ['request_uri' => '', 'resource_class' => 'Foo', 'operation_name' => 'post', 'output' => ['class' => null]];
159159
$serializerProphecy = $this->prophesize(SerializerInterface::class);
160160

161161
$serializerContextBuilderProphecy = $this->prophesize(SerializerContextBuilderInterface::class);

0 commit comments

Comments
 (0)