Skip to content

Commit 53ec00d

Browse files
vincentchalamonalanpoulain
authored andcommitted
fix: Symfony components compatibility
1 parent bd1a12a commit 53ec00d

File tree

78 files changed

+172
-304
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+172
-304
lines changed

composer.json

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,24 @@
1212
"homepage": "https://dunglas.fr"
1313
}
1414
],
15+
"repositories": [
16+
{
17+
"type": "git",
18+
"url": "[email protected]:cdaguerre/contexts.git"
19+
}
20+
],
1521
"require": {
1622
"php": ">=8.1",
1723
"doctrine/inflector": "^1.0 || ^2.0",
1824
"fig/link-util": "^1.0",
1925
"psr/cache": "^1.0 || ^2.0 || ^3.0",
2026
"psr/container": "^1.0 || ^2.0",
21-
"symfony/http-foundation": "^6.0",
22-
"symfony/http-kernel": "^6.0",
23-
"symfony/property-access": "^6.0",
24-
"symfony/property-info": "^6.0",
25-
"symfony/serializer": "^6.0",
26-
"symfony/web-link": "^6.0",
27+
"symfony/http-foundation": "^6.1",
28+
"symfony/http-kernel": "^6.1",
29+
"symfony/property-access": "^6.1",
30+
"symfony/property-info": "^6.1",
31+
"symfony/serializer": "^6.1",
32+
"symfony/web-link": "^6.1",
2733
"willdurand/negotiation": "^2.0.3 || ^3.0"
2834
},
2935
"require-dev": {
@@ -54,37 +60,37 @@
5460
"psr/log": "^1.0 || ^2.0 || ^3.0",
5561
"ramsey/uuid": "^3.7 || ^4.0",
5662
"ramsey/uuid-doctrine": "^1.4",
57-
"soyuka/contexts": "dev-main",
63+
"behatch/contexts": "dev-patch-1",
5864
"soyuka/stubs-mongodb": "^1.0",
59-
"symfony/asset": "^6.0",
60-
"symfony/browser-kit": "^6.0",
61-
"symfony/cache": "^6.0",
62-
"symfony/config": "^6.0",
63-
"symfony/console": "^6.0",
64-
"symfony/css-selector": "^6.0",
65-
"symfony/dependency-injection": "^6.0",
66-
"symfony/doctrine-bridge": "^6.0",
67-
"symfony/dom-crawler": "^6.0",
68-
"symfony/error-handler": "^6.0",
69-
"symfony/event-dispatcher": "^6.0",
70-
"symfony/expression-language": "^6.0",
71-
"symfony/finder": "^6.0",
72-
"symfony/form": "^6.0",
73-
"symfony/framework-bundle": "^6.0",
74-
"symfony/http-client": "^6.0",
75-
"symfony/intl": "^6.0",
65+
"symfony/asset": "^6.1",
66+
"symfony/browser-kit": "^6.1",
67+
"symfony/cache": "^6.1",
68+
"symfony/config": "^6.1",
69+
"symfony/console": "^6.1",
70+
"symfony/css-selector": "^6.1",
71+
"symfony/dependency-injection": "^6.1",
72+
"symfony/doctrine-bridge": "^6.1",
73+
"symfony/dom-crawler": "^6.1",
74+
"symfony/error-handler": "^6.1",
75+
"symfony/event-dispatcher": "^6.1",
76+
"symfony/expression-language": "^6.1",
77+
"symfony/finder": "^6.1",
78+
"symfony/form": "^6.1",
79+
"symfony/framework-bundle": "^6.1",
80+
"symfony/http-client": "^6.1",
81+
"symfony/intl": "^6.1",
7682
"symfony/maker-bundle": "^1.24",
7783
"symfony/mercure-bundle": "*",
78-
"symfony/messenger": "^6.0",
79-
"symfony/phpunit-bridge": "^6.0",
80-
"symfony/routing": "^6.0",
81-
"symfony/security-bundle": "^6.0",
82-
"symfony/security-core": "^6.0",
83-
"symfony/twig-bundle": "^6.0",
84-
"symfony/uid": "^6.0",
85-
"symfony/validator": "^6.0",
86-
"symfony/web-profiler-bundle": "^6.0",
87-
"symfony/yaml": "^6.0",
84+
"symfony/messenger": "^6.1",
85+
"symfony/phpunit-bridge": "^6.1",
86+
"symfony/routing": "^6.1",
87+
"symfony/security-bundle": "^6.1",
88+
"symfony/security-core": "^6.1",
89+
"symfony/twig-bundle": "^6.1",
90+
"symfony/uid": "^6.1",
91+
"symfony/validator": "^6.1",
92+
"symfony/web-profiler-bundle": "^6.1",
93+
"symfony/yaml": "^6.1",
8894
"twig/twig": "^1.42.3 || ^2.12 || ^3.0",
8995
"webonyx/graphql-php": "^14.0"
9096
},
@@ -136,9 +142,6 @@
136142
"extra": {
137143
"branch-alias": {
138144
"dev-main": "3.0.x-dev"
139-
},
140-
"symfony": {
141-
"require": "^6.0"
142145
}
143146
}
144147
}

src/Elasticsearch/Filter/AbstractFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ protected function getMetadata(string $resourceClass, string $property): array
117117
return $noop;
118118
}
119119

120-
if ($type->isCollection() && null === $type = method_exists(Type::class, 'getCollectionValueTypes') ? ($type->getCollectionValueTypes()[0] ?? null) : $type->getCollectionValueType()) {
120+
if ($type->isCollection() && null === $type = $type->getCollectionValueTypes()[0] ?? null) {
121121
return $noop;
122122
}
123123

src/Elasticsearch/Serializer/DocumentNormalizer.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,15 @@ public function __construct(ResourceMetadataCollectionFactoryInterface $resource
4545
/**
4646
* {@inheritdoc}
4747
*/
48-
public function supportsDenormalization($data, $type, $format = null, array $context = []): bool
48+
public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
4949
{
5050
return self::FORMAT === $format && parent::supportsDenormalization($data, $type, $format, $context); // @phpstan-ignore-line symfony bc-layer
5151
}
5252

5353
/**
5454
* {@inheritdoc}
55-
*
56-
* @return mixed
5755
*/
58-
public function denormalize($data, $class, $format = null, array $context = [])
56+
public function denormalize(mixed $data, string $class, string $format = null, array $context = []): mixed
5957
{
6058
if (\is_string($data['_id'] ?? null) && \is_array($data['_source'] ?? null)) {
6159
$data = $this->populateIdentifier($data, $class)['_source'];
@@ -67,7 +65,7 @@ public function denormalize($data, $class, $format = null, array $context = [])
6765
/**
6866
* {@inheritdoc}
6967
*/
70-
public function supportsNormalization($data, $format = null, array $context = []): bool
68+
public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool
7169
{
7270
// prevent the use of lower priority normalizers (e.g. serializer.normalizer.object) for this format
7371
return self::FORMAT === $format;
@@ -77,10 +75,8 @@ public function supportsNormalization($data, $format = null, array $context = []
7775
* {@inheritdoc}
7876
*
7977
* @throws LogicException
80-
*
81-
* @return array|string|int|float|bool|\ArrayObject|null
8278
*/
83-
public function normalize($object, $format = null, array $context = [])
79+
public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
8480
{
8581
throw new LogicException(sprintf('%s is a write-only format.', self::FORMAT));
8682
}

src/Elasticsearch/Serializer/ItemNormalizer.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,8 @@ public function hasCacheableSupportsMethod(): bool
5555
* {@inheritdoc}
5656
*
5757
* @throws LogicException
58-
*
59-
* @return mixed
6058
*/
61-
public function denormalize($data, $type, $format = null, array $context = [])
59+
public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed
6260
{
6361
if (!$this->decorated instanceof DenormalizerInterface) {
6462
throw new LogicException(sprintf('The decorated normalizer must be an instance of "%s".', DenormalizerInterface::class));
@@ -72,7 +70,7 @@ public function denormalize($data, $type, $format = null, array $context = [])
7270
*
7371
* @throws LogicException
7472
*/
75-
public function supportsDenormalization($data, $type, $format = null, array $context = []): bool
73+
public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
7674
{
7775
if (!$this->decorated instanceof DenormalizerInterface) {
7876
throw new LogicException(sprintf('The decorated normalizer must be an instance of "%s".', DenormalizerInterface::class));
@@ -84,15 +82,15 @@ public function supportsDenormalization($data, $type, $format = null, array $con
8482
/**
8583
* {@inheritdoc}
8684
*/
87-
public function normalize($object, $format = null, array $context = []): array
85+
public function normalize(mixed $object, string $format = null, array $context = []): array
8886
{
8987
return $this->decorated->normalize($object, $format, $context);
9088
}
9189

9290
/**
9391
* {@inheritdoc}
9492
*/
95-
public function supportsNormalization($data, $format = null, array $context = []): bool
93+
public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool
9694
{
9795
return DocumentNormalizer::FORMAT !== $format && $this->decorated->supportsNormalization($data, $format);
9896
}

src/Elasticsearch/Serializer/NameConverter/InnerFieldsNameConverter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ public function __construct(?NameConverterInterface $decorated = null)
3636
/**
3737
* {@inheritdoc}
3838
*/
39-
public function normalize($propertyName, string $class = null, string $format = null, array $context = []): string
39+
public function normalize(string $propertyName, string $class = null, string $format = null, array $context = []): string
4040
{
4141
return $this->convertInnerFields($propertyName, true, $class, $format, $context);
4242
}
4343

4444
/**
4545
* {@inheritdoc}
4646
*/
47-
public function denormalize($propertyName, string $class = null, string $format = null, array $context = []): string
47+
public function denormalize(string $propertyName, string $class = null, string $format = null, array $context = []): string
4848
{
4949
return $this->convertInnerFields($propertyName, false, $class, $format, $context);
5050
}

src/Elasticsearch/Util/FieldDatatypeTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ private function getNestedFieldPath(string $resourceClass, string $property): ?s
7777
}
7878

7979
if (
80-
null !== ($type = method_exists(Type::class, 'getCollectionValueTypes') ? ($type->getCollectionValueTypes()[0] ?? null) : $type->getCollectionValueType())
80+
null !== ($type = $type->getCollectionValueTypes()[0] ?? null)
8181
&& Type::BUILTIN_TYPE_OBJECT === $type->getBuiltinType()
8282
&& null !== ($className = $type->getClassName())
8383
&& $this->resourceClassResolver->isResourceClass($className)

src/GraphQl/Serializer/Exception/ErrorNormalizer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ final class ErrorNormalizer implements NormalizerInterface
2727
/**
2828
* {@inheritdoc}
2929
*/
30-
public function normalize($object, $format = null, array $context = []): array
30+
public function normalize(mixed $object, string $format = null, array $context = []): array
3131
{
3232
return FormattedError::createFromException($object);
3333
}
3434

3535
/**
3636
* {@inheritdoc}
3737
*/
38-
public function supportsNormalization($data, $format = null, array $context = []): bool
38+
public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool
3939
{
4040
return $data instanceof Error;
4141
}

src/GraphQl/Serializer/Exception/HttpExceptionNormalizer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ final class HttpExceptionNormalizer implements NormalizerInterface
2828
/**
2929
* {@inheritdoc}
3030
*/
31-
public function normalize($object, $format = null, array $context = []): array
31+
public function normalize(mixed $object, string $format = null, array $context = []): array
3232
{
3333
/** @var HttpExceptionInterface */
3434
$httpException = $object->getPrevious();
@@ -43,7 +43,7 @@ public function normalize($object, $format = null, array $context = []): array
4343
/**
4444
* {@inheritdoc}
4545
*/
46-
public function supportsNormalization($data, $format = null, array $context = []): bool
46+
public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool
4747
{
4848
return $data instanceof Error && $data->getPrevious() instanceof HttpExceptionInterface;
4949
}

src/GraphQl/Serializer/Exception/RuntimeExceptionNormalizer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ final class RuntimeExceptionNormalizer implements NormalizerInterface
2727
/**
2828
* {@inheritdoc}
2929
*/
30-
public function normalize($object, $format = null, array $context = []): array
30+
public function normalize(mixed $object, string $format = null, array $context = []): array
3131
{
3232
/** @var \RuntimeException */
3333
$runtimeException = $object->getPrevious();
@@ -40,7 +40,7 @@ public function normalize($object, $format = null, array $context = []): array
4040
/**
4141
* {@inheritdoc}
4242
*/
43-
public function supportsNormalization($data, $format = null, array $context = []): bool
43+
public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool
4444
{
4545
return $data instanceof Error && $data->getPrevious() instanceof \RuntimeException;
4646
}

src/GraphQl/Serializer/Exception/ValidationExceptionNormalizer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function __construct(array $exceptionToStatus = [])
3838
/**
3939
* {@inheritdoc}
4040
*/
41-
public function normalize($object, $format = null, array $context = []): array
41+
public function normalize(mixed $object, string $format = null, array $context = []): array
4242
{
4343
/** @var ValidationException */
4444
$validationException = $object->getPrevious();
@@ -73,7 +73,7 @@ public function normalize($object, $format = null, array $context = []): array
7373
/**
7474
* {@inheritdoc}
7575
*/
76-
public function supportsNormalization($data, $format = null, array $context = []): bool
76+
public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool
7777
{
7878
return $data instanceof Error && $data->getPrevious() instanceof ValidationException;
7979
}

0 commit comments

Comments
 (0)