Skip to content

Commit 71a1417

Browse files
Merge pull request #4847 from vincentchalamon/main
Fix some todo
2 parents bfbdad3 + d500eb6 commit 71a1417

File tree

7 files changed

+5
-104
lines changed

7 files changed

+5
-104
lines changed

features/graphql/non_resource.feature

Lines changed: 0 additions & 92 deletions
This file was deleted.

features/json/relation.feature

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ Feature: JSON relations support
151151
}
152152
"""
153153

154-
# TODO: to remove in 3.0
155154
Scenario: Create a related dummy with a relation using plain identifiers
156155
When I add "Content-Type" header equal to "application/json"
157156
And I send a "POST" request to "/related_dummies" with body:
@@ -185,7 +184,6 @@ Feature: JSON relations support
185184
}
186185
"""
187186

188-
# TODO: to remove in 3.0
189187
Scenario: Passing a (valid) plain identifier on a relation
190188
When I add "Content-Type" header equal to "application/json"
191189
And I send a "POST" request to "/dummies" with body:

features/main/uuid.feature

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,6 @@ Feature: Using uuid identifier on resource
195195
And the response should be in JSON
196196
And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8"
197197

198-
# @TODO remove the tag "@symfony/uid" in 3.0
199-
@symfony/uid
200198
@!mongodb
201199
@createSchema
202200
Scenario: Retrieve a resource identified by Symfony\Component\Uid\Uuid

src/GraphQl/Resolver/Stage/SerializeStage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use ApiPlatform\GraphQl\Resolver\Util\IdentifierTrait;
1717
use ApiPlatform\GraphQl\Serializer\ItemNormalizer;
1818
use ApiPlatform\GraphQl\Serializer\SerializerContextBuilderInterface;
19+
use ApiPlatform\Metadata\CollectionOperationInterface;
1920
use ApiPlatform\Metadata\GraphQl\Operation;
2021
use ApiPlatform\State\Pagination\Pagination;
2122
use ApiPlatform\State\Pagination\PaginatorInterface;
@@ -47,8 +48,7 @@ public function __construct(NormalizerInterface $normalizer, SerializerContextBu
4748
*/
4849
public function __invoke($itemOrCollection, string $resourceClass, Operation $operation, array $context): ?array
4950
{
50-
// TODO: replace by $operation->isCollection and $operation instanceof CollectionOperationInterface
51-
$isCollection = $context['is_collection'];
51+
$isCollection = $context['is_collection'] || $operation instanceof CollectionOperationInterface;
5252
$isMutation = $context['is_mutation'];
5353
$isSubscription = $context['is_subscription'];
5454
$shortName = $operation->getShortName();

src/JsonApi/Serializer/ItemNormalizer.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,6 @@ private function getIncludedNestedResources(string $relationshipName, array $con
459459
}, $filtered);
460460
}
461461

462-
// TODO: this code is similar to the one used in JsonLd
463462
private function getResourceShortName(string $resourceClass): string
464463
{
465464
if ($this->resourceClassResolver->isResourceClass($resourceClass)) {

src/OpenApi/Model/Parameter.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,12 @@ public function __construct(string $name, string $in, string $description = '',
5656
}
5757
}
5858

59-
// TODO: string not ?string
60-
public function getName(): ?string
59+
public function getName(): string
6160
{
6261
return $this->name;
6362
}
6463

65-
// TODO: string not ?string
66-
public function getIn(): ?string
64+
public function getIn(): string
6765
{
6866
return $this->in;
6967
}

src/Symfony/Bundle/Resources/config/http_cache_purger.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<service id="api_platform.http_cache.purger.varnish" alias="api_platform.http_cache.purger.varnish.ban" public="false" />
1111
<service id="api_platform.http_cache.purger.varnish.ban" class="ApiPlatform\HttpCache\VarnishPurger" public="false" />
1212
<service id="api_platform.http_cache.purger.varnish.xkey" class="ApiPlatform\HttpCache\VarnishXKeyPurger" public="false">
13-
<argument type="collection"></argument>
13+
<argument type="collection"/>
1414
<argument>%api_platform.http_cache.invalidation.max_header_length%</argument>
1515
<argument>%api_platform.http_cache.invalidation.xkey.glue%</argument>
1616
</service>

0 commit comments

Comments
 (0)