1
1
# Run these steps to update this file:
2
2
sed -i 's/ *"\*\*\/Tests\/"//' composer.json
3
3
composer u -o
4
- SYMFONY_PATCH_TYPE_DECLARATIONS='force=2&php=8.0 ' php .github/patch-types.php
4
+ SYMFONY_PATCH_TYPE_DECLARATIONS='force=2&php=8.1 ' php .github/patch-types.php
5
5
head=$(sed '/^diff /Q' .github/expected-missing-return-types.diff)
6
- (echo "$head" && echo && git diff -U2 composer.json src/) > .github/expected-missing-return-types.diff
6
+ (echo "$head" && echo && git diff -U2 src/) > .github/expected-missing-return-types.diff
7
7
git checkout composer.json src/
8
8
9
- diff --git a/composer.json b/composer.json
10
- index c7b7eac4c7..2b60fb6a19 100644
11
- --- a/composer.json
12
- +++ b/composer.json
13
- @@ -180,5 +180,5 @@
14
- ],
15
- "exclude-from-classmap": [
16
- - "**/Tests/"
17
- +
18
- ]
19
- },
20
9
diff --git a/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php b/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php
21
10
index d68ae4c8b3..8e980a9e70 100644
22
11
--- a/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php
@@ -60,6 +49,17 @@ index 697e34cb77..9a1e4c5618 100644
60
49
+ protected function filterResponse(object $response): Response
61
50
{
62
51
return $response;
52
+ diff --git a/src/Symfony/Component/Config/Definition/Builder/NodeBuilder.php b/src/Symfony/Component/Config/Definition/Builder/NodeBuilder.php
53
+ index 89d6adb70e..c569992efc 100644
54
+ --- a/src/Symfony/Component/Config/Definition/Builder/NodeBuilder.php
55
+ +++ b/src/Symfony/Component/Config/Definition/Builder/NodeBuilder.php
56
+ @@ -108,5 +108,5 @@ class NodeBuilder implements NodeParentInterface
57
+ * @return NodeDefinition&ParentNodeDefinitionInterface
58
+ */
59
+ - public function end()
60
+ + public function end(): NodeDefinition&ParentNodeDefinitionInterface
61
+ {
62
+ return $this->parent;
63
63
diff --git a/src/Symfony/Component/Config/Definition/ConfigurationInterface.php b/src/Symfony/Component/Config/Definition/ConfigurationInterface.php
64
64
index 7b5d443fe6..d64ae0d024 100644
65
65
--- a/src/Symfony/Component/Config/Definition/ConfigurationInterface.php
@@ -156,7 +156,7 @@ index 6b1c6c5fbe..bb80ed461e 100644
156
156
+ public function isFresh(ResourceInterface $resource, int $timestamp): bool;
157
157
}
158
158
diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php
159
- index 0ed5649b8a..6c814bf82c 100644
159
+ index c654b93790..ce744f5c6d 100644
160
160
--- a/src/Symfony/Component/Console/Application.php
161
161
+++ b/src/Symfony/Component/Console/Application.php
162
162
@@ -218,5 +218,5 @@ class Application implements ResetInterface
@@ -209,17 +209,17 @@ index 0ed5649b8a..6c814bf82c 100644
209
209
{
210
210
foreach ($command->getHelperSet() as $helper) {
211
211
diff --git a/src/Symfony/Component/Console/Command/Command.php b/src/Symfony/Component/Console/Command/Command.php
212
- index 0bd3426c07..b38caf989e 100644
212
+ index e84307207a..bc503462c1 100644
213
213
--- a/src/Symfony/Component/Console/Command/Command.php
214
214
+++ b/src/Symfony/Component/Console/Command/Command.php
215
- @@ -171 ,5 +171 ,5 @@ class Command
215
+ @@ -187 ,5 +187 ,5 @@ class Command
216
216
* @return bool
217
217
*/
218
218
- public function isEnabled()
219
219
+ public function isEnabled(): bool
220
220
{
221
221
return true;
222
- @@ -197 ,5 +197 ,5 @@ class Command
222
+ @@ -213 ,5 +213 ,5 @@ class Command
223
223
* @see setCode()
224
224
*/
225
225
- protected function execute(InputInterface $input, OutputInterface $output)
@@ -273,7 +273,7 @@ index c2824f4578..032f5c2318 100644
273
273
{
274
274
if (\is_array($value)) {
275
275
diff --git a/src/Symfony/Component/DependencyInjection/Container.php b/src/Symfony/Component/DependencyInjection/Container.php
276
- index b9dd838898..3a8cb63eac 100644
276
+ index f9820f5ede..d28a418429 100644
277
277
--- a/src/Symfony/Component/DependencyInjection/Container.php
278
278
+++ b/src/Symfony/Component/DependencyInjection/Container.php
279
279
@@ -108,5 +108,5 @@ class Container implements ContainerInterface, ResetInterface
@@ -284,7 +284,7 @@ index b9dd838898..3a8cb63eac 100644
284
284
{
285
285
return $this->parameterBag->get($name);
286
286
diff --git a/src/Symfony/Component/DependencyInjection/ContainerInterface.php b/src/Symfony/Component/DependencyInjection/ContainerInterface.php
287
- index aa5d6b317e..31ffbca4ef 100644
287
+ index cad44026c0..14cd192e07 100644
288
288
--- a/src/Symfony/Component/DependencyInjection/ContainerInterface.php
289
289
+++ b/src/Symfony/Component/DependencyInjection/ContainerInterface.php
290
290
@@ -53,5 +53,5 @@ interface ContainerInterface extends PsrContainerInterface
@@ -611,6 +611,17 @@ index 125b6eae50..ac327e8981 100644
611
611
+ public function createLockFromKey(Key $key, ?float $ttl = 300.0, bool $autoRelease = true): SharedLockInterface
612
612
{
613
613
$lock = new Lock($key, $this->store, $ttl, $autoRelease);
614
+ diff --git a/src/Symfony/Component/Messenger/Bridge/AmazonSqs/Transport/AmazonSqsTransport.php b/src/Symfony/Component/Messenger/Bridge/AmazonSqs/Transport/AmazonSqsTransport.php
615
+ index 297fccbd3f..4c47d95b38 100644
616
+ --- a/src/Symfony/Component/Messenger/Bridge/AmazonSqs/Transport/AmazonSqsTransport.php
617
+ +++ b/src/Symfony/Component/Messenger/Bridge/AmazonSqs/Transport/AmazonSqsTransport.php
618
+ @@ -109,5 +109,5 @@ class AmazonSqsTransport implements TransportInterface, SetupableTransportInterf
619
+ * @return MessageCountAwareInterface&ReceiverInterface
620
+ */
621
+ - private function getReceiver(): ReceiverInterface
622
+ + private function getReceiver(): MessageCountAwareInterface&ReceiverInterface
623
+ {
624
+ return $this->receiver ??= new AmazonSqsReceiver($this->connection, $this->serializer);
614
625
diff --git a/src/Symfony/Component/OptionsResolver/OptionsResolver.php b/src/Symfony/Component/OptionsResolver/OptionsResolver.php
615
626
index 205c15b4cd..e93e460ed1 100644
616
627
--- a/src/Symfony/Component/OptionsResolver/OptionsResolver.php
@@ -696,10 +707,10 @@ index fbb37d9f94..522e0487a9 100644
696
707
+ public function isIndex(int $index): bool;
697
708
}
698
709
diff --git a/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php b/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php
699
- index cfffdb2f71..3e2261898a 100644
710
+ index 972d169caa..0b6dae1abe 100644
700
711
--- a/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php
701
712
+++ b/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php
702
- @@ -725 ,5 +725 ,5 @@ class PropertyAccessorTest extends TestCase
713
+ @@ -743 ,5 +743 ,5 @@ class PropertyAccessorTest extends TestCase
703
714
* @return mixed
704
715
*/
705
716
- public function getFoo()
@@ -899,7 +910,7 @@ index 7f86ed8d78..cf084423ec 100644
899
910
{
900
911
if (null !== $object = $this->extractObjectToPopulate($class, $context, self::OBJECT_TO_POPULATE)) {
901
912
diff --git a/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php
902
- index a8943113c4..2983dabd0f 100644
913
+ index 1abdb634ce..d2e7f41562 100644
903
914
--- a/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php
904
915
+++ b/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php
905
916
@@ -138,5 +138,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
@@ -916,35 +927,35 @@ index a8943113c4..2983dabd0f 100644
916
927
+ public function normalize(mixed $object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
917
928
{
918
929
if (!isset($context['cache_key'])) {
919
- @@ -279 ,5 +279 ,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
930
+ @@ -280 ,5 +280 ,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
920
931
* {@inheritdoc}
921
932
*/
922
933
- protected function instantiateObject(array &$data, string $class, array &$context, \ReflectionClass $reflectionClass, array|bool $allowedAttributes, string $format = null)
923
934
+ protected function instantiateObject(array &$data, string $class, array &$context, \ReflectionClass $reflectionClass, array|bool $allowedAttributes, string $format = null): object
924
935
{
925
936
if ($this->classDiscriminatorResolver && $mapping = $this->classDiscriminatorResolver->getMappingForClass($class)) {
926
- @@ -341 ,5 +341 ,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
937
+ @@ -342 ,5 +342 ,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
927
938
* @return string[]
928
939
*/
929
940
- abstract protected function extractAttributes(object $object, string $format = null, array $context = []);
930
941
+ abstract protected function extractAttributes(object $object, string $format = null, array $context = []): array;
931
942
932
943
/**
933
- @@ -348 ,5 +348 ,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
944
+ @@ -349 ,5 +349 ,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
934
945
* @return mixed
935
946
*/
936
947
- abstract protected function getAttributeValue(object $object, string $attribute, string $format = null, array $context = []);
937
948
+ abstract protected function getAttributeValue(object $object, string $attribute, string $format = null, array $context = []): mixed;
938
949
939
950
/**
940
- @@ -355 ,5 +355 ,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
951
+ @@ -356 ,5 +356 ,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
941
952
* @param array $context
942
953
*/
943
954
- public function supportsDenormalization(mixed $data, string $type, string $format = null /*, array $context = [] */)
944
955
+ public function supportsDenormalization(mixed $data, string $type, string $format = null /*, array $context = [] */): bool
945
956
{
946
957
return class_exists($type) || (interface_exists($type, false) && $this->classDiscriminatorResolver && null !== $this->classDiscriminatorResolver->getMappingForClass($type));
947
- @@ -363 ,5 +363 ,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
958
+ @@ -364 ,5 +364 ,5 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
948
959
* {@inheritdoc}
949
960
*/
950
961
- public function denormalize(mixed $data, string $type, string $format = null, array $context = [])
@@ -1012,6 +1023,38 @@ index 4c088b94f9..86107a636d 100644
1012
1023
- abstract protected function extractFromDirectory(string|array $resource);
1013
1024
+ abstract protected function extractFromDirectory(string|array $resource): iterable;
1014
1025
}
1026
+ diff --git a/src/Symfony/Component/Translation/Test/ProviderTestCase.php b/src/Symfony/Component/Translation/Test/ProviderTestCase.php
1027
+ index a3bd4b99ac..81fb8728e0 100644
1028
+ --- a/src/Symfony/Component/Translation/Test/ProviderTestCase.php
1029
+ +++ b/src/Symfony/Component/Translation/Test/ProviderTestCase.php
1030
+ @@ -61,5 +61,5 @@ abstract class ProviderTestCase extends TestCase
1031
+ * @return LoaderInterface&MockObject
1032
+ */
1033
+ - protected function getLoader(): LoaderInterface
1034
+ + protected function getLoader(): LoaderInterface&MockObject
1035
+ {
1036
+ return $this->loader ??= $this->createMock(LoaderInterface::class);
1037
+ @@ -69,5 +69,5 @@ abstract class ProviderTestCase extends TestCase
1038
+ * @return LoggerInterface&MockObject
1039
+ */
1040
+ - protected function getLogger(): LoggerInterface
1041
+ + protected function getLogger(): LoggerInterface&MockObject
1042
+ {
1043
+ return $this->logger ??= $this->createMock(LoggerInterface::class);
1044
+ @@ -82,5 +82,5 @@ abstract class ProviderTestCase extends TestCase
1045
+ * @return XliffFileDumper&MockObject
1046
+ */
1047
+ - protected function getXliffFileDumper(): XliffFileDumper
1048
+ + protected function getXliffFileDumper(): XliffFileDumper&MockObject
1049
+ {
1050
+ return $this->xliffFileDumper ??= $this->createMock(XliffFileDumper::class);
1051
+ @@ -90,5 +90,5 @@ abstract class ProviderTestCase extends TestCase
1052
+ * @return TranslatorBagInterface&MockObject
1053
+ */
1054
+ - protected function getTranslatorBag(): TranslatorBagInterface
1055
+ + protected function getTranslatorBag(): TranslatorBagInterface&MockObject
1056
+ {
1057
+ return $this->translatorBag ??= $this->createMock(TranslatorBagInterface::class);
1015
1058
diff --git a/src/Symfony/Component/Validator/Constraint.php b/src/Symfony/Component/Validator/Constraint.php
1016
1059
index 46432f2f4c..47ac39d5e3 100644
1017
1060
--- a/src/Symfony/Component/Validator/Constraint.php
0 commit comments