Skip to content

Commit

Permalink
Merge pull request #4847 from vincentchalamon/main
Browse files Browse the repository at this point in the history
Fix some todo
  • Loading branch information
vincentchalamon authored Jul 25, 2022
2 parents bfbdad3 + d500eb6 commit 71a1417
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 104 deletions.
92 changes: 0 additions & 92 deletions features/graphql/non_resource.feature

This file was deleted.

2 changes: 0 additions & 2 deletions features/json/relation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ Feature: JSON relations support
}
"""

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

# TODO: to remove in 3.0
Scenario: Passing a (valid) plain identifier on a relation
When I add "Content-Type" header equal to "application/json"
And I send a "POST" request to "/dummies" with body:
Expand Down
2 changes: 0 additions & 2 deletions features/main/uuid.feature
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,6 @@ Feature: Using uuid identifier on resource
And the response should be in JSON
And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8"

# @TODO remove the tag "@symfony/uid" in 3.0
@symfony/uid
@!mongodb
@createSchema
Scenario: Retrieve a resource identified by Symfony\Component\Uid\Uuid
Expand Down
4 changes: 2 additions & 2 deletions src/GraphQl/Resolver/Stage/SerializeStage.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use ApiPlatform\GraphQl\Resolver\Util\IdentifierTrait;
use ApiPlatform\GraphQl\Serializer\ItemNormalizer;
use ApiPlatform\GraphQl\Serializer\SerializerContextBuilderInterface;
use ApiPlatform\Metadata\CollectionOperationInterface;
use ApiPlatform\Metadata\GraphQl\Operation;
use ApiPlatform\State\Pagination\Pagination;
use ApiPlatform\State\Pagination\PaginatorInterface;
Expand Down Expand Up @@ -47,8 +48,7 @@ public function __construct(NormalizerInterface $normalizer, SerializerContextBu
*/
public function __invoke($itemOrCollection, string $resourceClass, Operation $operation, array $context): ?array
{
// TODO: replace by $operation->isCollection and $operation instanceof CollectionOperationInterface
$isCollection = $context['is_collection'];
$isCollection = $context['is_collection'] || $operation instanceof CollectionOperationInterface;
$isMutation = $context['is_mutation'];
$isSubscription = $context['is_subscription'];
$shortName = $operation->getShortName();
Expand Down
1 change: 0 additions & 1 deletion src/JsonApi/Serializer/ItemNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,6 @@ private function getIncludedNestedResources(string $relationshipName, array $con
}, $filtered);
}

// TODO: this code is similar to the one used in JsonLd
private function getResourceShortName(string $resourceClass): string
{
if ($this->resourceClassResolver->isResourceClass($resourceClass)) {
Expand Down
6 changes: 2 additions & 4 deletions src/OpenApi/Model/Parameter.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,12 @@ public function __construct(string $name, string $in, string $description = '',
}
}

// TODO: string not ?string
public function getName(): ?string
public function getName(): string
{
return $this->name;
}

// TODO: string not ?string
public function getIn(): ?string
public function getIn(): string
{
return $this->in;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/Resources/config/http_cache_purger.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<service id="api_platform.http_cache.purger.varnish" alias="api_platform.http_cache.purger.varnish.ban" public="false" />
<service id="api_platform.http_cache.purger.varnish.ban" class="ApiPlatform\HttpCache\VarnishPurger" public="false" />
<service id="api_platform.http_cache.purger.varnish.xkey" class="ApiPlatform\HttpCache\VarnishXKeyPurger" public="false">
<argument type="collection"></argument>
<argument type="collection"/>
<argument>%api_platform.http_cache.invalidation.max_header_length%</argument>
<argument>%api_platform.http_cache.invalidation.xkey.glue%</argument>
</service>
Expand Down

0 comments on commit 71a1417

Please sign in to comment.