Skip to content

Commit 6874a09

Browse files
committed
style: apply CS fixer corrections
- Remove unused imports (ReflectionClass, ReflectionException, ReflectionNamedType) - Use fully qualified class names instead (\ReflectionClass, etc.) - Remove trailing empty line
1 parent 55f4482 commit 6874a09

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

src/Serializer/QueryParameterTypeCastSerializer.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@
2626
use PrestaShopBundle\ApiPlatform\LocalizedValueUpdater;
2727
use PrestaShopBundle\ApiPlatform\NormalizationMapper;
2828
use PrestaShopBundle\ApiPlatform\Serializer\CQRSApiSerializer;
29-
use ReflectionClass;
30-
use ReflectionException;
31-
use ReflectionNamedType;
3229
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
3330
use Symfony\Component\Serializer\Serializer;
3431

@@ -65,7 +62,7 @@ public function denormalize(mixed $data, string $type, ?string $format = null, a
6562
private function castQueryParametersToExpectedTypes(array $data, string $queryClass): array
6663
{
6764
try {
68-
$reflection = new ReflectionClass($queryClass);
65+
$reflection = new \ReflectionClass($queryClass);
6966
$constructor = $reflection->getConstructor();
7067

7168
if (!$constructor) {
@@ -81,7 +78,7 @@ private function castQueryParametersToExpectedTypes(array $data, string $queryCl
8178

8279
$type = $parameter->getType();
8380

84-
if (!$type instanceof ReflectionNamedType || !$type->isBuiltin()) {
81+
if (!$type instanceof \ReflectionNamedType || !$type->isBuiltin()) {
8582
continue;
8683
}
8784

@@ -92,11 +89,10 @@ private function castQueryParametersToExpectedTypes(array $data, string $queryCl
9289
default => $data[$paramName],
9390
};
9491
}
95-
} catch (ReflectionException $e) {
92+
} catch (\ReflectionException $e) {
9693
return $data;
9794
}
9895

9996
return $data;
10097
}
10198
}
102-

0 commit comments

Comments
 (0)