Skip to content

Commit 0edca90

Browse files
committed
cs
1 parent 78518b6 commit 0edca90

File tree

4 files changed

+10
-16
lines changed

4 files changed

+10
-16
lines changed

src/Hydra/Serializer/CollectionFiltersNormalizer.php

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

1414
namespace ApiPlatform\Hydra\Serializer;
1515

16+
use ApiPlatform\Hydra\IriTemplate\IriTemplateMapping;
17+
use ApiPlatform\Hydra\State\Util\SearchHelperTrait;
1618
use ApiPlatform\JsonLd\Serializer\HydraPrefixTrait;
1719
use ApiPlatform\Metadata\FilterInterface;
18-
use ApiPlatform\Metadata\Parameters;
19-
use ApiPlatform\Metadata\QueryParameterInterface;
2020
use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface;
2121
use ApiPlatform\Metadata\ResourceClassResolverInterface;
2222
use ApiPlatform\State\Util\StateOptionsTrait;
23-
use ApiPlatform\Hydra\State\Util\SearchHelperTrait;
24-
use ApiPlatform\Hydra\IriTemplate\IriTemplateMapping;
2523
use Psr\Container\ContainerInterface;
2624
use Symfony\Component\Serializer\Exception\UnexpectedValueException;
2725
use Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer;
@@ -36,8 +34,8 @@
3634
final class CollectionFiltersNormalizer implements NormalizerInterface, NormalizerAwareInterface
3735
{
3836
use HydraPrefixTrait;
39-
use StateOptionsTrait;
4037
use SearchHelperTrait;
38+
use StateOptionsTrait;
4139
private ?ContainerInterface $filterLocator = null;
4240

4341
/**

src/Hydra/Serializer/PartialCollectionViewNormalizer.php

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

1414
namespace ApiPlatform\Hydra\Serializer;
1515

16+
use ApiPlatform\Hydra\State\Util\PaginationHelperTrait;
1617
use ApiPlatform\JsonLd\Serializer\HydraPrefixTrait;
1718
use ApiPlatform\Metadata\HttpOperation;
1819
use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface;
1920
use ApiPlatform\Metadata\UrlGeneratorInterface;
2021
use ApiPlatform\Metadata\Util\IriHelper;
2122
use ApiPlatform\State\Pagination\PaginatorInterface;
2223
use ApiPlatform\State\Pagination\PartialPaginatorInterface;
23-
use ApiPlatform\Hydra\State\Util\PaginationHelperTrait;
24-
use ApiPlatform\Hydra\PartialCollectionView;
2524
use Symfony\Component\PropertyAccess\PropertyAccess;
2625
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
2726
use Symfony\Component\Serializer\Exception\UnexpectedValueException;
@@ -63,7 +62,7 @@ public function normalize(mixed $object, ?string $format = null, array $context
6362
throw new UnexpectedValueException('Expected data to be an array');
6463
}
6564

66-
$paginated = ($object instanceof PartialPaginatorInterface);
65+
$paginated = $object instanceof PartialPaginatorInterface;
6766
if ($paginated && $object instanceof PaginatorInterface) {
6867
$paginated = 1. !== $object->getLastPage();
6968
}

src/Hydra/State/JsonStreamerProcessor.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,24 @@
1414
namespace ApiPlatform\Hydra\State;
1515

1616
use ApiPlatform\Hydra\Collection;
17-
use ApiPlatform\Hydra\IriTemplate;
18-
use ApiPlatform\Hydra\IriTemplateMapping;
1917
use ApiPlatform\Hydra\PartialCollectionView;
18+
use ApiPlatform\Hydra\State\Util\PaginationHelperTrait;
19+
use ApiPlatform\Hydra\State\Util\SearchHelperTrait;
2020
use ApiPlatform\Metadata\CollectionOperationInterface;
2121
use ApiPlatform\Metadata\Error;
2222
use ApiPlatform\Metadata\HttpOperation;
2323
use ApiPlatform\Metadata\IriConverterInterface;
2424
use ApiPlatform\Metadata\Operation;
2525
use ApiPlatform\Metadata\Operation\Factory\OperationMetadataFactoryInterface;
26-
use ApiPlatform\Metadata\QueryParameterInterface;
2726
use ApiPlatform\Metadata\ResourceClassResolverInterface;
2827
use ApiPlatform\Metadata\UrlGeneratorInterface;
29-
use ApiPlatform\Metadata\Util\IriHelper;
30-
use ApiPlatform\State\Util\HttpResponseStatusTrait;
3128
use ApiPlatform\State\Pagination\PaginatorInterface;
3229
use ApiPlatform\State\ProcessorInterface;
3330
use ApiPlatform\State\Util\HttpResponseHeadersTrait;
31+
use ApiPlatform\State\Util\HttpResponseStatusTrait;
3432
use Symfony\Component\HttpFoundation\Response;
3533
use Symfony\Component\HttpFoundation\StreamedResponse;
3634
use Symfony\Component\JsonStreamer\StreamWriterInterface;
37-
use ApiPlatform\Hydra\State\Util\PaginationHelperTrait;
38-
use ApiPlatform\Hydra\State\Util\SearchHelperTrait;
3935
use Symfony\Component\TypeInfo\Type;
4036

4137
/**

src/JsonLd/JsonStreamer/ValueTransformer/ContextValueTransformer.php

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

1414
namespace ApiPlatform\JsonLd\JsonStreamer\ValueTransformer;
1515

16+
use ApiPlatform\Metadata\Exception\RuntimeException;
1617
use ApiPlatform\Metadata\UrlGeneratorInterface;
1718
use Symfony\Component\JsonStreamer\ValueTransformer\ValueTransformerInterface;
1819
use Symfony\Component\TypeInfo\Type;
19-
use ApiPlatform\Metadata\Exception\RuntimeException;
2020

2121
final class ContextValueTransformer implements ValueTransformerInterface
2222
{
@@ -30,6 +30,7 @@ public function transform(mixed $value, array $options = []): mixed
3030
if (!isset($options['operation'])) {
3131
throw new RuntimeException('Operation is not defined');
3232
}
33+
3334
return $this->urlGenerator->generate('api_jsonld_context', ['shortName' => $options['operation']->getShortName()], $options['operation']->getUrlGenerationStrategy());
3435
}
3536

0 commit comments

Comments
 (0)