@@ -4,12 +4,13 @@ composer u -o
4
4
SYMFONY_PATCH_TYPE_DECLARATIONS='force=2&php=8.0' php .github/patch-types.php
5
5
head=$(sed '/^diff /Q' .github/expected-missing-return-types.diff)
6
6
(echo "$head" && echo && git diff -U2 composer.json src/) > .github/expected-missing-return-types.diff
7
+ git checkout composer.json src/
7
8
8
9
diff --git a/composer.json b/composer.json
9
- index 1750d55ee2..c18494167a 100644
10
+ index c7b7eac4c7..2b60fb6a19 100644
10
11
--- a/composer.json
11
12
+++ b/composer.json
12
- @@ -175 ,5 +175 ,5 @@
13
+ @@ -180 ,5 +180 ,5 @@
13
14
],
14
15
"exclude-from-classmap": [
15
16
- "**/Tests/"
@@ -236,32 +237,32 @@ index 1d2b7bfb84..cb1f66152d 100644
236
237
+ public function getName(): string;
237
238
}
238
239
diff --git a/src/Symfony/Component/Console/Input/InputInterface.php b/src/Symfony/Component/Console/Input/InputInterface.php
239
- index 024da1884e..943790e875 100644
240
+ index 3af991a76f..742e2508f3 100644
240
241
--- a/src/Symfony/Component/Console/Input/InputInterface.php
241
242
+++ b/src/Symfony/Component/Console/Input/InputInterface.php
242
- @@ -54 ,5 +54 ,5 @@ interface InputInterface
243
+ @@ -57 ,5 +57 ,5 @@ interface InputInterface
243
244
* @return mixed
244
245
*/
245
246
- public function getParameterOption(string|array $values, string|bool|int|float|array|null $default = false, bool $onlyParams = false);
246
247
+ public function getParameterOption(string|array $values, string|bool|int|float|array|null $default = false, bool $onlyParams = false): mixed;
247
248
248
249
/**
249
- @@ -84 ,5 +84 ,5 @@ interface InputInterface
250
+ @@ -87 ,5 +87 ,5 @@ interface InputInterface
250
251
* @throws InvalidArgumentException When argument given doesn't exist
251
252
*/
252
253
- public function getArgument(string $name);
253
254
+ public function getArgument(string $name): mixed;
254
255
255
256
/**
256
- @@ -112 ,5 +112 ,5 @@ interface InputInterface
257
+ @@ -115 ,5 +115 ,5 @@ interface InputInterface
257
258
* @throws InvalidArgumentException When option given doesn't exist
258
259
*/
259
260
- public function getOption(string $name);
260
261
+ public function getOption(string $name): mixed;
261
262
262
263
/**
263
264
diff --git a/src/Symfony/Component/DependencyInjection/Compiler/AbstractRecursivePass.php b/src/Symfony/Component/DependencyInjection/Compiler/AbstractRecursivePass.php
264
- index 326d8d4f5f..e62124c7af 100644
265
+ index c2824f4578..032f5c2318 100644
265
266
--- a/src/Symfony/Component/DependencyInjection/Compiler/AbstractRecursivePass.php
266
267
+++ b/src/Symfony/Component/DependencyInjection/Compiler/AbstractRecursivePass.php
267
268
@@ -71,5 +71,5 @@ abstract class AbstractRecursivePass implements CompilerPassInterface
@@ -557,7 +558,7 @@ index cf0e243c6b..292b907ea8 100644
557
558
{
558
559
$this->surrogate?->addSurrogateCapability($request);
559
560
diff --git a/src/Symfony/Component/HttpKernel/HttpKernelBrowser.php b/src/Symfony/Component/HttpKernel/HttpKernelBrowser.php
560
- index 3ecc2c739c..d50834b6d9 100644
561
+ index 1557da575a..7e5a2a9859 100644
561
562
--- a/src/Symfony/Component/HttpKernel/HttpKernelBrowser.php
562
563
+++ b/src/Symfony/Component/HttpKernel/HttpKernelBrowser.php
563
564
@@ -61,5 +61,5 @@ class HttpKernelBrowser extends AbstractBrowser
@@ -610,23 +611,6 @@ index 125b6eae50..ac327e8981 100644
610
611
+ public function createLockFromKey(Key $key, ?float $ttl = 300.0, bool $autoRelease = true): SharedLockInterface
611
612
{
612
613
$lock = new Lock($key, $this->store, $ttl, $autoRelease);
613
- diff --git a/src/Symfony/Component/Messenger/Envelope.php b/src/Symfony/Component/Messenger/Envelope.php
614
- index bb1194ad1b..27731b9cb0 100644
615
- --- a/src/Symfony/Component/Messenger/Envelope.php
616
- +++ b/src/Symfony/Component/Messenger/Envelope.php
617
- @@ -13,4 +13,5 @@ namespace Symfony\Component\Messenger;
618
-
619
- use Symfony\Component\Messenger\Stamp\StampInterface;
620
- + use Symfony\Component\Messenger\Stamp\StampInterface as TStamp;
621
-
622
- /**
623
- @@ -101,5 +102,5 @@ final class Envelope
624
- * @return TStamp|null
625
- */
626
- - public function last(string $stampFqcn): ?StampInterface
627
- + public function last(string $stampFqcn): ?TStamp
628
- {
629
- return isset($this->stamps[$stampFqcn]) ? end($this->stamps[$stampFqcn]) : null;
630
614
diff --git a/src/Symfony/Component/OptionsResolver/OptionsResolver.php b/src/Symfony/Component/OptionsResolver/OptionsResolver.php
631
615
index 205c15b4cd..e93e460ed1 100644
632
616
--- a/src/Symfony/Component/OptionsResolver/OptionsResolver.php
@@ -711,6 +695,17 @@ index fbb37d9f94..522e0487a9 100644
711
695
- public function isIndex(int $index);
712
696
+ public function isIndex(int $index): bool;
713
697
}
698
+ diff --git a/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php b/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php
699
+ index cfffdb2f71..3e2261898a 100644
700
+ --- a/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php
701
+ +++ b/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php
702
+ @@ -725,5 +725,5 @@ class PropertyAccessorTest extends TestCase
703
+ * @return mixed
704
+ */
705
+ - public function getFoo()
706
+ + public function getFoo(): mixed
707
+ {
708
+ return $this->foo;
714
709
diff --git a/src/Symfony/Component/PropertyInfo/PropertyAccessExtractorInterface.php b/src/Symfony/Component/PropertyInfo/PropertyAccessExtractorInterface.php
715
710
index f9ee787130..61f8b6d5be 100644
716
711
--- a/src/Symfony/Component/PropertyInfo/PropertyAccessExtractorInterface.php
@@ -862,7 +857,7 @@ index 480ea8ad6b..fa43d6a6e9 100644
862
857
+ public function getListeners(Request $request): array;
863
858
}
864
859
diff --git a/src/Symfony/Component/Serializer/Encoder/DecoderInterface.php b/src/Symfony/Component/Serializer/Encoder/DecoderInterface.php
865
- index 84a84ad1f3..6f66b6d32a 100644
860
+ index f38069e471..0966eb3e89 100644
866
861
--- a/src/Symfony/Component/Serializer/Encoder/DecoderInterface.php
867
862
+++ b/src/Symfony/Component/Serializer/Encoder/DecoderInterface.php
868
863
@@ -35,5 +35,5 @@ interface DecoderInterface
@@ -872,14 +867,14 @@ index 84a84ad1f3..6f66b6d32a 100644
872
867
+ public function decode(string $data, string $format, array $context = []): mixed;
873
868
874
869
/**
875
- @@ -44 ,4 +44 ,4 @@ interface DecoderInterface
870
+ @@ -45 ,4 +45 ,4 @@ interface DecoderInterface
876
871
* @return bool
877
872
*/
878
- - public function supportsDecoding(string $format);
879
- + public function supportsDecoding(string $format): bool;
873
+ - public function supportsDecoding(string $format /*, array $context = [] */ );
874
+ + public function supportsDecoding(string $format /*, array $context = [] */ ): bool;
880
875
}
881
876
diff --git a/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php
882
- index b0a1f3218b..893fe59e2f 100644
877
+ index 7f86ed8d78..cf084423ec 100644
883
878
--- a/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php
884
879
+++ b/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php
885
880
@@ -223,5 +223,5 @@ abstract class AbstractNormalizer implements NormalizerInterface, DenormalizerIn
@@ -904,59 +899,60 @@ index b0a1f3218b..893fe59e2f 100644
904
899
{
905
900
if (null !== $object = $this->extractObjectToPopulate($class, $context, self::OBJECT_TO_POPULATE)) {
906
901
diff --git a/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php
907
- index 3e1e7edc8e..e025b2bc4a 100644
902
+ index a8943113c4..2983dabd0f 100644
908
903
--- a/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php
909
904
+++ b/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php
910
- @@ -136 ,5 +136 ,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
911
- * {@inheritdoc}
905
+ @@ -138 ,5 +138 ,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
906
+ * @param array $context
912
907
*/
913
- - public function supportsNormalization(mixed $data, string $format = null)
914
- + public function supportsNormalization(mixed $data, string $format = null): bool
908
+ - public function supportsNormalization(mixed $data, string $format = null /*, array $context = [] */ )
909
+ + public function supportsNormalization(mixed $data, string $format = null /*, array $context = [] */ ): bool
915
910
{
916
911
return \is_object($data) && !$data instanceof \Traversable;
917
- @@ -144 ,5 +144 ,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
912
+ @@ -146 ,5 +146 ,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
918
913
* {@inheritdoc}
919
914
*/
920
915
- public function normalize(mixed $object, string $format = null, array $context = [])
921
916
+ public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
922
917
{
923
918
if (!isset($context['cache_key'])) {
924
- @@ -277 ,5 +277 ,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
919
+ @@ -279 ,5 +279 ,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
925
920
* {@inheritdoc}
926
921
*/
927
922
- protected function instantiateObject(array &$data, string $class, array &$context, \ReflectionClass $reflectionClass, array|bool $allowedAttributes, string $format = null)
928
923
+ protected function instantiateObject(array &$data, string $class, array &$context, \ReflectionClass $reflectionClass, array|bool $allowedAttributes, string $format = null): object
929
924
{
930
925
if ($this->classDiscriminatorResolver && $mapping = $this->classDiscriminatorResolver->getMappingForClass($class)) {
931
- @@ -339 ,5 +339 ,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
926
+ @@ -341 ,5 +341 ,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
932
927
* @return string[]
933
928
*/
934
929
- abstract protected function extractAttributes(object $object, string $format = null, array $context = []);
935
930
+ abstract protected function extractAttributes(object $object, string $format = null, array $context = []): array;
936
931
937
932
/**
938
- @@ -346,10 +346,10 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
933
+ @@ -348,5 +348,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
939
934
* @return mixed
940
935
*/
941
936
- abstract protected function getAttributeValue(object $object, string $attribute, string $format = null, array $context = []);
942
937
+ abstract protected function getAttributeValue(object $object, string $attribute, string $format = null, array $context = []): mixed;
943
938
944
939
/**
945
- * {@inheritdoc}
940
+ @@ -355,5 +355,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
941
+ * @param array $context
946
942
*/
947
- - public function supportsDenormalization(mixed $data, string $type, string $format = null)
948
- + public function supportsDenormalization(mixed $data, string $type, string $format = null): bool
943
+ - public function supportsDenormalization(mixed $data, string $type, string $format = null /*, array $context = [] */ )
944
+ + public function supportsDenormalization(mixed $data, string $type, string $format = null /*, array $context = [] */ ): bool
949
945
{
950
946
return class_exists($type) || (interface_exists($type, false) && $this->classDiscriminatorResolver && null !== $this->classDiscriminatorResolver->getMappingForClass($type));
951
- @@ -359 ,5 +359 ,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
947
+ @@ -363 ,5 +363 ,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
952
948
* {@inheritdoc}
953
949
*/
954
950
- public function denormalize(mixed $data, string $type, string $format = null, array $context = [])
955
951
+ public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed
956
952
{
957
953
if (!isset($context['cache_key'])) {
958
954
diff --git a/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php b/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php
959
- index 5e94400b80..726d89cbb1 100644
955
+ index 1c708738a1..3b6c9d5056 100644
960
956
--- a/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php
961
957
+++ b/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php
962
958
@@ -45,5 +45,5 @@ interface DenormalizerInterface
@@ -966,14 +962,14 @@ index 5e94400b80..726d89cbb1 100644
966
962
+ public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed;
967
963
968
964
/**
969
- @@ -56 ,4 +56 ,4 @@ interface DenormalizerInterface
965
+ @@ -57 ,4 +57 ,4 @@ interface DenormalizerInterface
970
966
* @return bool
971
967
*/
972
- - public function supportsDenormalization(mixed $data, string $type, string $format = null);
973
- + public function supportsDenormalization(mixed $data, string $type, string $format = null): bool;
968
+ - public function supportsDenormalization(mixed $data, string $type, string $format = null /*, array $context = [] */ );
969
+ + public function supportsDenormalization(mixed $data, string $type, string $format = null /*, array $context = [] */ ): bool;
974
970
}
975
971
diff --git a/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php b/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php
976
- index 30eeafb47b..a7a60ad2f2 100644
972
+ index 741f19e50b..acf3be931b 100644
977
973
--- a/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php
978
974
+++ b/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php
979
975
@@ -37,5 +37,5 @@ interface NormalizerInterface
@@ -983,11 +979,11 @@ index 30eeafb47b..a7a60ad2f2 100644
983
979
+ public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null;
984
980
985
981
/**
986
- @@ -47 ,4 +47 ,4 @@ interface NormalizerInterface
982
+ @@ -48 ,4 +48 ,4 @@ interface NormalizerInterface
987
983
* @return bool
988
984
*/
989
- - public function supportsNormalization(mixed $data, string $format = null);
990
- + public function supportsNormalization(mixed $data, string $format = null): bool;
985
+ - public function supportsNormalization(mixed $data, string $format = null /*, array $context = [] */ );
986
+ + public function supportsNormalization(mixed $data, string $format = null /*, array $context = [] */ ): bool;
991
987
}
992
988
diff --git a/src/Symfony/Component/Templating/Helper/HelperInterface.php b/src/Symfony/Component/Templating/Helper/HelperInterface.php
993
989
index 5dade65db5..db0d0a00ea 100644
@@ -1017,31 +1013,31 @@ index 4c088b94f9..86107a636d 100644
1017
1013
+ abstract protected function extractFromDirectory(string|array $resource): iterable;
1018
1014
}
1019
1015
diff --git a/src/Symfony/Component/Validator/Constraint.php b/src/Symfony/Component/Validator/Constraint.php
1020
- index d6dcdf178f..0ab8d9c10e 100644
1016
+ index 46432f2f4c..47ac39d5e3 100644
1021
1017
--- a/src/Symfony/Component/Validator/Constraint.php
1022
1018
+++ b/src/Symfony/Component/Validator/Constraint.php
1023
- @@ -239 ,5 +239 ,5 @@ abstract class Constraint
1019
+ @@ -243 ,5 +243 ,5 @@ abstract class Constraint
1024
1020
* @see __construct()
1025
1021
*/
1026
1022
- public function getDefaultOption()
1027
1023
+ public function getDefaultOption(): ?string
1028
1024
{
1029
1025
return null;
1030
- @@ -253 ,5 +253 ,5 @@ abstract class Constraint
1026
+ @@ -257 ,5 +257 ,5 @@ abstract class Constraint
1031
1027
* @see __construct()
1032
1028
*/
1033
1029
- public function getRequiredOptions()
1034
1030
+ public function getRequiredOptions(): array
1035
1031
{
1036
1032
return [];
1037
- @@ -267 ,5 +267 ,5 @@ abstract class Constraint
1033
+ @@ -271 ,5 +271 ,5 @@ abstract class Constraint
1038
1034
* @return string
1039
1035
*/
1040
1036
- public function validatedBy()
1041
1037
+ public function validatedBy(): string
1042
1038
{
1043
1039
return static::class.'Validator';
1044
- @@ -281 ,5 +281 ,5 @@ abstract class Constraint
1040
+ @@ -285 ,5 +285 ,5 @@ abstract class Constraint
1045
1041
* @return string|string[] One or more constant values
1046
1042
*/
1047
1043
- public function getTargets()
0 commit comments