1
1
# Run these steps to update this file:
2
- sed -i 's/ *"\*\*\/Tests\/"//' composer.json
2
+ sed -i 's/ *"\*\*\/Tests\/",\? //' composer.json
3
3
composer u -o
4
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
6
git checkout src/Symfony/Contracts/Service/ResetInterface.php
7
7
(echo "$head" && echo && git diff -U2 src/ | grep '^index ' -v) > .github/expected-missing-return-types.diff
8
8
git checkout composer.json src/
9
9
10
+ diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/AbstractLayoutTestCase.php b/src/Symfony/Bridge/Twig/Tests/Extension/AbstractLayoutTestCase.php
11
+ --- a/src/Symfony/Bridge/Twig/Tests/Extension/AbstractLayoutTestCase.php
12
+ +++ b/src/Symfony/Bridge/Twig/Tests/Extension/AbstractLayoutTestCase.php
13
+ @@ -52,5 +52,5 @@ abstract class AbstractLayoutTestCase extends FormLayoutTestCase
14
+ * @return FormExtensionInterface[]
15
+ */
16
+ - protected function getExtensions()
17
+ + protected function getExtensions(): array
18
+ {
19
+ return [
10
20
diff --git a/src/Symfony/Component/BrowserKit/AbstractBrowser.php b/src/Symfony/Component/BrowserKit/AbstractBrowser.php
11
21
--- a/src/Symfony/Component/BrowserKit/AbstractBrowser.php
12
22
+++ b/src/Symfony/Component/BrowserKit/AbstractBrowser.php
@@ -22,7 +32,7 @@ diff --git a/src/Symfony/Component/BrowserKit/AbstractBrowser.php b/src/Symfony/
22
32
*/
23
33
- abstract protected function doRequest(object $request);
24
34
+ abstract protected function doRequest(object $request): object;
25
-
35
+
26
36
/**
27
37
@@ -451,5 +451,5 @@ abstract class AbstractBrowser
28
38
* @throws LogicException When this abstract class is not implemented
@@ -146,21 +156,21 @@ diff --git a/src/Symfony/Component/DependencyInjection/Extension/ExtensionInterf
146
156
*/
147
157
- public function load(array $configs, ContainerBuilder $container);
148
158
+ public function load(array $configs, ContainerBuilder $container): void;
149
-
159
+
150
160
/**
151
161
@@ -37,5 +37,5 @@ interface ExtensionInterface
152
162
* @return string
153
163
*/
154
164
- public function getNamespace();
155
165
+ public function getNamespace(): string;
156
-
166
+
157
167
/**
158
168
@@ -44,5 +44,5 @@ interface ExtensionInterface
159
169
* @return string|false
160
170
*/
161
171
- public function getXsdValidationBasePath();
162
172
+ public function getXsdValidationBasePath(): string|false;
163
-
173
+
164
174
/**
165
175
@@ -53,4 +53,4 @@ interface ExtensionInterface
166
176
* @return string
@@ -189,13 +199,13 @@ diff --git a/src/Symfony/Component/EventDispatcher/EventSubscriberInterface.php
189
199
diff --git a/src/Symfony/Component/ExpressionLanguage/ExpressionLanguage.php b/src/Symfony/Component/ExpressionLanguage/ExpressionLanguage.php
190
200
--- a/src/Symfony/Component/ExpressionLanguage/ExpressionLanguage.php
191
201
+++ b/src/Symfony/Component/ExpressionLanguage/ExpressionLanguage.php
192
- @@ -139 ,5 +139 ,5 @@ class ExpressionLanguage
202
+ @@ -149 ,5 +149 ,5 @@ class ExpressionLanguage
193
203
* @return void
194
204
*/
195
205
- protected function registerFunctions()
196
206
+ protected function registerFunctions(): void
197
207
{
198
- $this->addFunction(ExpressionFunction::fromPhp( 'constant')) ;
208
+ $basicPhpFunctions = [ 'constant', 'min', 'max'] ;
199
209
diff --git a/src/Symfony/Component/Form/AbstractType.php b/src/Symfony/Component/Form/AbstractType.php
200
210
--- a/src/Symfony/Component/Form/AbstractType.php
201
211
+++ b/src/Symfony/Component/Form/AbstractType.php
@@ -249,42 +259,97 @@ diff --git a/src/Symfony/Component/Form/FormTypeInterface.php b/src/Symfony/Comp
249
259
*/
250
260
- public function getParent();
251
261
+ public function getParent(): ?string;
252
-
262
+
253
263
/**
254
264
@@ -34,5 +34,5 @@ interface FormTypeInterface
255
265
* @return void
256
266
*/
257
267
- public function configureOptions(OptionsResolver $resolver);
258
268
+ public function configureOptions(OptionsResolver $resolver): void;
259
-
269
+
260
270
/**
261
271
@@ -48,5 +48,5 @@ interface FormTypeInterface
262
272
* @see FormTypeExtensionInterface::buildForm()
263
273
*/
264
274
- public function buildForm(FormBuilderInterface $builder, array $options);
265
275
+ public function buildForm(FormBuilderInterface $builder, array $options): void;
266
-
276
+
267
277
/**
268
278
@@ -66,5 +66,5 @@ interface FormTypeInterface
269
279
* @see FormTypeExtensionInterface::buildView()
270
280
*/
271
281
- public function buildView(FormView $view, FormInterface $form, array $options);
272
282
+ public function buildView(FormView $view, FormInterface $form, array $options): void;
273
-
283
+
274
284
/**
275
285
@@ -85,5 +85,5 @@ interface FormTypeInterface
276
286
* @see FormTypeExtensionInterface::finishView()
277
287
*/
278
288
- public function finishView(FormView $view, FormInterface $form, array $options);
279
289
+ public function finishView(FormView $view, FormInterface $form, array $options): void;
280
-
290
+
281
291
/**
282
292
@@ -95,4 +95,4 @@ interface FormTypeInterface
283
293
* @return string
284
294
*/
285
295
- public function getBlockPrefix();
286
296
+ public function getBlockPrefix(): string;
287
297
}
298
+ diff --git a/src/Symfony/Component/Form/Test/FormIntegrationTestCase.php b/src/Symfony/Component/Form/Test/FormIntegrationTestCase.php
299
+ --- a/src/Symfony/Component/Form/Test/FormIntegrationTestCase.php
300
+ +++ b/src/Symfony/Component/Form/Test/FormIntegrationTestCase.php
301
+ @@ -40,5 +40,5 @@ abstract class FormIntegrationTestCase extends TestCase
302
+ * @return FormExtensionInterface[]
303
+ */
304
+ - protected function getExtensions()
305
+ + protected function getExtensions(): array
306
+ {
307
+ return [];
308
+ @@ -48,5 +48,5 @@ abstract class FormIntegrationTestCase extends TestCase
309
+ * @return FormTypeExtensionInterface[]
310
+ */
311
+ - protected function getTypeExtensions()
312
+ + protected function getTypeExtensions(): array
313
+ {
314
+ return [];
315
+ @@ -56,5 +56,5 @@ abstract class FormIntegrationTestCase extends TestCase
316
+ * @return FormTypeInterface[]
317
+ */
318
+ - protected function getTypes()
319
+ + protected function getTypes(): array
320
+ {
321
+ return [];
322
+ @@ -64,5 +64,5 @@ abstract class FormIntegrationTestCase extends TestCase
323
+ * @return FormTypeGuesserInterface[]
324
+ */
325
+ - protected function getTypeGuessers()
326
+ + protected function getTypeGuessers(): array
327
+ {
328
+ return [];
329
+ diff --git a/src/Symfony/Component/Form/Test/TypeTestCase.php b/src/Symfony/Component/Form/Test/TypeTestCase.php
330
+ --- a/src/Symfony/Component/Form/Test/TypeTestCase.php
331
+ +++ b/src/Symfony/Component/Form/Test/TypeTestCase.php
332
+ @@ -33,5 +33,5 @@ abstract class TypeTestCase extends FormIntegrationTestCase
333
+ * @return FormExtensionInterface[]
334
+ */
335
+ - protected function getExtensions()
336
+ + protected function getExtensions(): array
337
+ {
338
+ $extensions = [];
339
+ @@ -47,5 +47,5 @@ abstract class TypeTestCase extends FormIntegrationTestCase
340
+ * @return void
341
+ */
342
+ - public static function assertDateTimeEquals(\DateTime $expected, \DateTime $actual)
343
+ + public static function assertDateTimeEquals(\DateTime $expected, \DateTime $actual): void
344
+ {
345
+ self::assertEquals($expected->format('c'), $actual->format('c'));
346
+ @@ -55,5 +55,5 @@ abstract class TypeTestCase extends FormIntegrationTestCase
347
+ * @return void
348
+ */
349
+ - public static function assertDateIntervalEquals(\DateInterval $expected, \DateInterval $actual)
350
+ + public static function assertDateIntervalEquals(\DateInterval $expected, \DateInterval $actual): void
351
+ {
352
+ self::assertEquals($expected->format('%RP%yY%mM%dDT%hH%iM%sS'), $actual->format('%RP%yY%mM%dDT%hH%iM%sS'));
288
353
diff --git a/src/Symfony/Component/HttpKernel/Bundle/Bundle.php b/src/Symfony/Component/HttpKernel/Bundle/Bundle.php
289
354
--- a/src/Symfony/Component/HttpKernel/Bundle/Bundle.php
290
355
+++ b/src/Symfony/Component/HttpKernel/Bundle/Bundle.php
@@ -324,26 +389,26 @@ diff --git a/src/Symfony/Component/HttpKernel/Bundle/BundleInterface.php b/src/S
324
389
*/
325
390
- public function boot();
326
391
+ public function boot(): void;
327
-
392
+
328
393
/**
329
394
@@ -35,5 +35,5 @@ interface BundleInterface
330
395
* @return void
331
396
*/
332
397
- public function shutdown();
333
398
+ public function shutdown(): void;
334
-
399
+
335
400
/**
336
401
@@ -44,5 +44,5 @@ interface BundleInterface
337
402
* @return void
338
403
*/
339
404
- public function build(ContainerBuilder $container);
340
405
+ public function build(ContainerBuilder $container): void;
341
-
406
+
342
407
/**
343
408
diff --git a/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php
344
409
--- a/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php
345
410
+++ b/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php
346
- @@ -101 ,5 +101 ,5 @@ abstract class DataCollector implements DataCollectorInterface
411
+ @@ -113 ,5 +113 ,5 @@ abstract class DataCollector implements DataCollectorInterface
347
412
* @return void
348
413
*/
349
414
- public function reset()
@@ -358,7 +423,7 @@ diff --git a/src/Symfony/Component/HttpKernel/DataCollector/DataCollectorInterfa
358
423
*/
359
424
- public function collect(Request $request, Response $response, ?\Throwable $exception = null);
360
425
+ public function collect(Request $request, Response $response, ?\Throwable $exception = null): void;
361
-
426
+
362
427
/**
363
428
@@ -35,4 +35,4 @@ interface DataCollectorInterface extends ResetInterface
364
429
* @return string
@@ -383,38 +448,38 @@ diff --git a/src/Symfony/Component/HttpKernel/KernelInterface.php b/src/Symfony/
383
448
*/
384
449
- public function registerContainerConfiguration(LoaderInterface $loader);
385
450
+ public function registerContainerConfiguration(LoaderInterface $loader): void;
386
-
451
+
387
452
/**
388
453
@@ -44,5 +44,5 @@ interface KernelInterface extends HttpKernelInterface
389
454
* @return void
390
455
*/
391
456
- public function boot();
392
457
+ public function boot(): void;
393
-
458
+
394
459
/**
395
460
@@ -53,5 +53,5 @@ interface KernelInterface extends HttpKernelInterface
396
461
* @return void
397
462
*/
398
463
- public function shutdown();
399
464
+ public function shutdown(): void;
400
-
465
+
401
466
/**
402
467
diff --git a/src/Symfony/Component/Routing/Loader/AttributeClassLoader.php b/src/Symfony/Component/Routing/Loader/AttributeClassLoader.php
403
468
--- a/src/Symfony/Component/Routing/Loader/AttributeClassLoader.php
404
469
+++ b/src/Symfony/Component/Routing/Loader/AttributeClassLoader.php
405
- @@ -234 ,5 +234 ,5 @@ abstract class AttributeClassLoader implements LoaderInterface
470
+ @@ -236 ,5 +236 ,5 @@ abstract class AttributeClassLoader implements LoaderInterface
406
471
* @return string
407
472
*/
408
473
- protected function getDefaultRouteName(\ReflectionClass $class, \ReflectionMethod $method)
409
474
+ protected function getDefaultRouteName(\ReflectionClass $class, \ReflectionMethod $method): string
410
475
{
411
476
$name = str_replace('\\', '_', $class->name).'_'.$method->name;
412
- @@ -333 ,5 +333 ,5 @@ abstract class AttributeClassLoader implements LoaderInterface
477
+ @@ -335 ,5 +335 ,5 @@ abstract class AttributeClassLoader implements LoaderInterface
413
478
* @return void
414
479
*/
415
480
- abstract protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot);
416
481
+ abstract protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot): void;
417
-
482
+
418
483
/**
419
484
diff --git a/src/Symfony/Component/Security/Core/Authentication/RememberMe/TokenProviderInterface.php b/src/Symfony/Component/Security/Core/Authentication/RememberMe/TokenProviderInterface.php
420
485
--- a/src/Symfony/Component/Security/Core/Authentication/RememberMe/TokenProviderInterface.php
@@ -424,21 +489,21 @@ diff --git a/src/Symfony/Component/Security/Core/Authentication/RememberMe/Token
424
489
*/
425
490
- public function loadTokenBySeries(string $series);
426
491
+ public function loadTokenBySeries(string $series): PersistentTokenInterface;
427
-
492
+
428
493
/**
429
494
@@ -35,5 +35,5 @@ interface TokenProviderInterface
430
495
* @return void
431
496
*/
432
497
- public function deleteTokenBySeries(string $series);
433
498
+ public function deleteTokenBySeries(string $series): void;
434
-
499
+
435
500
/**
436
501
@@ -44,5 +44,5 @@ interface TokenProviderInterface
437
502
* @throws TokenNotFoundException if the token is not found
438
503
*/
439
504
- public function updateToken(string $series, #[\SensitiveParameter] string $tokenValue, \DateTimeInterface $lastUsed);
440
505
+ public function updateToken(string $series, #[\SensitiveParameter] string $tokenValue, \DateTimeInterface $lastUsed): void;
441
-
506
+
442
507
/**
443
508
@@ -51,4 +51,4 @@ interface TokenProviderInterface
444
509
* @return void
@@ -449,28 +514,28 @@ diff --git a/src/Symfony/Component/Security/Core/Authentication/RememberMe/Token
449
514
diff --git a/src/Symfony/Component/Security/Http/Firewall.php b/src/Symfony/Component/Security/Http/Firewall.php
450
515
--- a/src/Symfony/Component/Security/Http/Firewall.php
451
516
+++ b/src/Symfony/Component/Security/Http/Firewall.php
452
- @@ -51 ,5 +51 ,5 @@ class Firewall implements EventSubscriberInterface
517
+ @@ -48 ,5 +48 ,5 @@ class Firewall implements EventSubscriberInterface
453
518
* @return void
454
519
*/
455
520
- public function onKernelRequest(RequestEvent $event)
456
521
+ public function onKernelRequest(RequestEvent $event): void
457
522
{
458
523
if (!$event->isMainRequest()) {
459
- @@ -99 ,5 +99 ,5 @@ class Firewall implements EventSubscriberInterface
524
+ @@ -96 ,5 +96 ,5 @@ class Firewall implements EventSubscriberInterface
460
525
* @return void
461
526
*/
462
527
- public function onKernelFinishRequest(FinishRequestEvent $event)
463
528
+ public function onKernelFinishRequest(FinishRequestEvent $event): void
464
529
{
465
530
$request = $event->getRequest();
466
- @@ -112 ,5 +112 ,5 @@ class Firewall implements EventSubscriberInterface
531
+ @@ -109 ,5 +109 ,5 @@ class Firewall implements EventSubscriberInterface
467
532
* @return array
468
533
*/
469
534
- public static function getSubscribedEvents()
470
535
+ public static function getSubscribedEvents(): array
471
536
{
472
537
return [
473
- @@ -123 ,5 +123 ,5 @@ class Firewall implements EventSubscriberInterface
538
+ @@ -120 ,5 +120 ,5 @@ class Firewall implements EventSubscriberInterface
474
539
* @return void
475
540
*/
476
541
- protected function callListeners(RequestEvent $event, iterable $listeners)
@@ -485,7 +550,7 @@ diff --git a/src/Symfony/Component/Translation/Extractor/ExtractorInterface.php
485
550
*/
486
551
- public function extract(string|iterable $resource, MessageCatalogue $catalogue);
487
552
+ public function extract(string|iterable $resource, MessageCatalogue $catalogue): void;
488
-
553
+
489
554
/**
490
555
@@ -36,4 +36,4 @@ interface ExtractorInterface
491
556
* @return void
@@ -501,7 +566,7 @@ diff --git a/src/Symfony/Component/Validator/ConstraintValidatorInterface.php b/
501
566
*/
502
567
- public function initialize(ExecutionContextInterface $context);
503
568
+ public function initialize(ExecutionContextInterface $context): void;
504
-
569
+
505
570
/**
506
571
@@ -31,4 +31,4 @@ interface ConstraintValidatorInterface
507
572
* @return void
@@ -526,7 +591,7 @@ diff --git a/src/Symfony/Contracts/Translation/LocaleAwareInterface.php b/src/Sy
526
591
*/
527
592
- public function setLocale(string $locale);
528
593
+ public function setLocale(string $locale): void;
529
-
594
+
530
595
/**
531
596
diff --git a/src/Symfony/Contracts/Translation/TranslatorTrait.php b/src/Symfony/Contracts/Translation/TranslatorTrait.php
532
597
--- a/src/Symfony/Contracts/Translation/TranslatorTrait.php
0 commit comments