Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c5a289f

Browse files
[Routing] Remove remaining deprecations
1 parent 8dc7b48 commit c5a289f

12 files changed

+80
-243
lines changed

.github/expected-missing-return-types.diff

Lines changed: 22 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ diff --git a/src/Symfony/Component/BrowserKit/AbstractBrowser.php b/src/Symfony/
2222
*/
2323
- abstract protected function doRequest(object $request);
2424
+ abstract protected function doRequest(object $request): object;
25-
25+
2626
/**
2727
@@ -455,5 +455,5 @@ abstract class AbstractBrowser
2828
* @throws LogicException When this abstract class is not implemented
@@ -156,21 +156,21 @@ diff --git a/src/Symfony/Component/DependencyInjection/Extension/ExtensionInterf
156156
*/
157157
- public function load(array $configs, ContainerBuilder $container);
158158
+ public function load(array $configs, ContainerBuilder $container): void;
159-
159+
160160
/**
161161
@@ -37,5 +37,5 @@ interface ExtensionInterface
162162
* @return string
163163
*/
164164
- public function getNamespace();
165165
+ public function getNamespace(): string;
166-
166+
167167
/**
168168
@@ -44,5 +44,5 @@ interface ExtensionInterface
169169
* @return string|false
170170
*/
171171
- public function getXsdValidationBasePath();
172172
+ public function getXsdValidationBasePath(): string|false;
173-
173+
174174
/**
175175
@@ -53,4 +53,4 @@ interface ExtensionInterface
176176
* @return string
@@ -259,35 +259,35 @@ diff --git a/src/Symfony/Component/Form/FormTypeInterface.php b/src/Symfony/Comp
259259
*/
260260
- public function getParent();
261261
+ public function getParent(): ?string;
262-
262+
263263
/**
264264
@@ -34,5 +34,5 @@ interface FormTypeInterface
265265
* @return void
266266
*/
267267
- public function configureOptions(OptionsResolver $resolver);
268268
+ public function configureOptions(OptionsResolver $resolver): void;
269-
269+
270270
/**
271271
@@ -48,5 +48,5 @@ interface FormTypeInterface
272272
* @see FormTypeExtensionInterface::buildForm()
273273
*/
274274
- public function buildForm(FormBuilderInterface $builder, array $options);
275275
+ public function buildForm(FormBuilderInterface $builder, array $options): void;
276-
276+
277277
/**
278278
@@ -66,5 +66,5 @@ interface FormTypeInterface
279279
* @see FormTypeExtensionInterface::buildView()
280280
*/
281281
- public function buildView(FormView $view, FormInterface $form, array $options);
282282
+ public function buildView(FormView $view, FormInterface $form, array $options): void;
283-
283+
284284
/**
285285
@@ -85,5 +85,5 @@ interface FormTypeInterface
286286
* @see FormTypeExtensionInterface::finishView()
287287
*/
288288
- public function finishView(FormView $view, FormInterface $form, array $options);
289289
+ public function finishView(FormView $view, FormInterface $form, array $options): void;
290-
290+
291291
/**
292292
@@ -95,4 +95,4 @@ interface FormTypeInterface
293293
* @return string
@@ -334,21 +334,21 @@ diff --git a/src/Symfony/Component/HttpKernel/Bundle/BundleInterface.php b/src/S
334334
*/
335335
- public function boot();
336336
+ public function boot(): void;
337-
337+
338338
/**
339339
@@ -35,5 +35,5 @@ interface BundleInterface
340340
* @return void
341341
*/
342342
- public function shutdown();
343343
+ public function shutdown(): void;
344-
344+
345345
/**
346346
@@ -44,5 +44,5 @@ interface BundleInterface
347347
* @return void
348348
*/
349349
- public function build(ContainerBuilder $container);
350350
+ public function build(ContainerBuilder $container): void;
351-
351+
352352
/**
353353
diff --git a/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php
354354
--- a/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php
@@ -368,7 +368,7 @@ diff --git a/src/Symfony/Component/HttpKernel/DataCollector/DataCollectorInterfa
368368
*/
369369
- public function collect(Request $request, Response $response, \Throwable $exception = null);
370370
+ public function collect(Request $request, Response $response, \Throwable $exception = null): void;
371-
371+
372372
/**
373373
@@ -35,4 +35,4 @@ interface DataCollectorInterface extends ResetInterface
374374
* @return string
@@ -393,31 +393,21 @@ diff --git a/src/Symfony/Component/HttpKernel/KernelInterface.php b/src/Symfony/
393393
*/
394394
- public function registerContainerConfiguration(LoaderInterface $loader);
395395
+ public function registerContainerConfiguration(LoaderInterface $loader): void;
396-
396+
397397
/**
398398
@@ -44,5 +44,5 @@ interface KernelInterface extends HttpKernelInterface
399399
* @return void
400400
*/
401401
- public function boot();
402402
+ public function boot(): void;
403-
403+
404404
/**
405405
@@ -53,5 +53,5 @@ interface KernelInterface extends HttpKernelInterface
406406
* @return void
407407
*/
408408
- public function shutdown();
409409
+ public function shutdown(): void;
410-
411-
/**
412-
diff --git a/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php b/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php
413-
--- a/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php
414-
+++ b/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php
415-
@@ -324,5 +324,5 @@ abstract class AnnotationClassLoader implements LoaderInterface
416-
* @return void
417-
*/
418-
- abstract protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot);
419-
+ abstract protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot): void;
420-
410+
421411
/**
422412
diff --git a/src/Symfony/Component/Security/Core/Authentication/RememberMe/TokenProviderInterface.php b/src/Symfony/Component/Security/Core/Authentication/RememberMe/TokenProviderInterface.php
423413
--- a/src/Symfony/Component/Security/Core/Authentication/RememberMe/TokenProviderInterface.php
@@ -427,21 +417,21 @@ diff --git a/src/Symfony/Component/Security/Core/Authentication/RememberMe/Token
427417
*/
428418
- public function loadTokenBySeries(string $series);
429419
+ public function loadTokenBySeries(string $series): PersistentTokenInterface;
430-
420+
431421
/**
432422
@@ -35,5 +35,5 @@ interface TokenProviderInterface
433423
* @return void
434424
*/
435425
- public function deleteTokenBySeries(string $series);
436426
+ public function deleteTokenBySeries(string $series): void;
437-
427+
438428
/**
439429
@@ -46,5 +46,5 @@ interface TokenProviderInterface
440430
* @throws TokenNotFoundException if the token is not found
441431
*/
442432
- public function updateToken(string $series, #[\SensitiveParameter] string $tokenValue, \DateTime $lastUsed);
443433
+ public function updateToken(string $series, #[\SensitiveParameter] string $tokenValue, \DateTime $lastUsed): void;
444-
434+
445435
/**
446436
@@ -53,4 +53,4 @@ interface TokenProviderInterface
447437
* @return void
@@ -488,7 +478,7 @@ diff --git a/src/Symfony/Component/Translation/Extractor/ExtractorInterface.php
488478
*/
489479
- public function extract(string|iterable $resource, MessageCatalogue $catalogue);
490480
+ public function extract(string|iterable $resource, MessageCatalogue $catalogue): void;
491-
481+
492482
/**
493483
@@ -36,4 +36,4 @@ interface ExtractorInterface
494484
* @return void
@@ -504,7 +494,7 @@ diff --git a/src/Symfony/Component/Validator/ConstraintValidatorInterface.php b/
504494
*/
505495
- public function initialize(ExecutionContextInterface $context);
506496
+ public function initialize(ExecutionContextInterface $context): void;
507-
497+
508498
/**
509499
@@ -31,4 +31,4 @@ interface ConstraintValidatorInterface
510500
* @return void
@@ -529,7 +519,7 @@ diff --git a/src/Symfony/Contracts/Translation/LocaleAwareInterface.php b/src/Sy
529519
*/
530520
- public function setLocale(string $locale);
531521
+ public function setLocale(string $locale): void;
532-
522+
533523
/**
534524
diff --git a/src/Symfony/Contracts/Translation/TranslatorTrait.php b/src/Symfony/Contracts/Translation/TranslatorTrait.php
535525
--- a/src/Symfony/Contracts/Translation/TranslatorTrait.php

UPGRADE-7.0.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ FrameworkBundle
248248
* Change default of some config options:
249249

250250
| option | default Symfony <7.0 | default in Symfony 7.0+ |
251-
| -------------------------------------------- | -------------------------- | --------------------------------------------------------------------------- |
251+
|----------------------------------------------|----------------------------|-----------------------------------------------------------------------------|
252252
| `framework.http_method_override` | `true` | `false` |
253253
| `framework.handle_all_throwables` | `false` | `true` |
254254
| `framework.php_errors.log` | `'%kernel.debug%'` | `true` |
@@ -260,6 +260,10 @@ FrameworkBundle
260260
| `framework.validation.email_validation_mode` | `'loose'` | `'html5'` |
261261
* Remove the `framework.validation.enable_annotations` config option, use `framework.validation.enable_attributes` instead
262262
* Remove the `framework.serializer.enable_annotations` config option, use `framework.serializer.enable_attributes` instead
263+
* Remove the `routing.loader.annotation` service, use the `routing.loader.attribute` service instead
264+
* Remove the `routing.loader.annotation.directory` service, use the `routing.loader.attribute.directory` service instead
265+
* Remove the `routing.loader.annotation.file` service, use the `routing.loader.attribute.file` service instead
266+
* Remove `AnnotatedRouteControllerLoader`, use `AttributeRouteControllerLoader` instead
263267

264268
HttpFoundation
265269
--------------
@@ -400,7 +404,9 @@ Routing
400404

401405
* Add parameter `array $routeParameters` to `UrlMatcher::handleRouteRequirements()`
402406
* Remove Doctrine annotations support in favor of native attributes. Use `Symfony\Component\Routing\Annotation\Route` as native attribute now
403-
* Change the constructor signature of `AnnotationClassLoader` to `__construct(?string $env = null)`, passing an annotation reader as first argument is not supported anymore
407+
* Remove `AnnotationClassLoader`, use `AttributeClassLoader` instead
408+
* Remove `AnnotationDirectoryLoader`, use `AttributeDirectoryLoader` instead
409+
* Remove `AnnotationFileLoader`, use `AttributeFileLoader` instead
404410

405411
Security
406412
--------

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ CHANGELOG
2424
* Make the `framework.validation.email_validation_mode` config option default to `html5`
2525
* Remove the `framework.validation.enable_annotations` config option, use `framework.validation.enable_attributes` instead
2626
* Remove the `framework.serializer.enable_annotations` config option, use `framework.serializer.enable_attributes` instead
27+
* Remove the `routing.loader.annotation` service, use the `routing.loader.attribute` service instead
28+
* Remove the `routing.loader.annotation.directory` service, use the `routing.loader.attribute.directory` service instead
29+
* Remove the `routing.loader.annotation.file` service, use the `routing.loader.attribute.file` service instead
30+
* Remove `AnnotatedRouteControllerLoader`, use `AttributeRouteControllerLoader` instead
2731

2832
6.4
2933
---

src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,29 +98,20 @@
9898
])
9999
->tag('routing.loader', ['priority' => -10])
100100

101-
->alias('routing.loader.annotation', 'routing.loader.attribute')
102-
->deprecate('symfony/routing', '6.4', 'The "%alias_id%" service is deprecated, use the "routing.loader.attribute" service instead.')
103-
104101
->set('routing.loader.attribute.directory', AttributeDirectoryLoader::class)
105102
->args([
106103
service('file_locator'),
107104
service('routing.loader.attribute'),
108105
])
109106
->tag('routing.loader', ['priority' => -10])
110107

111-
->alias('routing.loader.annotation.directory', 'routing.loader.attribute.directory')
112-
->deprecate('symfony/routing', '6.4', 'The "%alias_id%" service is deprecated, use the "routing.loader.attribute.directory" service instead.')
113-
114108
->set('routing.loader.attribute.file', AttributeFileLoader::class)
115109
->args([
116110
service('file_locator'),
117111
service('routing.loader.attribute'),
118112
])
119113
->tag('routing.loader', ['priority' => -10])
120114

121-
->alias('routing.loader.annotation.file', 'routing.loader.attribute.file')
122-
->deprecate('symfony/routing', '6.4', 'The "%alias_id%" service is deprecated, use the "routing.loader.attribute.file" service instead.')
123-
124115
->set('routing.loader.psr4', Psr4DirectoryLoader::class)
125116
->args([
126117
service('file_locator'),

src/Symfony/Bundle/FrameworkBundle/Routing/AttributeRouteControllerLoader.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@ class AttributeRouteControllerLoader extends AttributeClassLoader
2525
{
2626
/**
2727
* Configures the _controller default parameter of a given Route instance.
28-
*
29-
* @return void
3028
*/
31-
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot)
29+
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot): void
3230
{
3331
if ('__invoke' === $method->getName()) {
3432
$route->setDefault('_controller', $class->getName());
@@ -51,7 +49,3 @@ protected function getDefaultRouteName(\ReflectionClass $class, \ReflectionMetho
5149
return str_replace('__', '_', $name);
5250
}
5351
}
54-
55-
if (!class_exists(AnnotatedRouteControllerLoader::class, false)) {
56-
class_alias(AttributeRouteControllerLoader::class, AnnotatedRouteControllerLoader::class);
57-
}

src/Symfony/Component/Routing/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ CHANGELOG
66

77
* Add argument `$routeParameters` to `UrlMatcher::handleRouteRequirements()`
88
* Remove Doctrine annotations support in favor of native attributes
9-
* Change the constructor signature of `AnnotationClassLoader` to `__construct(?string $env = null)`, passing an annotation reader as first argument is not supported anymore
9+
* Remove `AnnotationClassLoader`, use `AttributeClassLoader` instead
10+
* Remove `AnnotationDirectoryLoader`, use `AttributeDirectoryLoader` instead
11+
* Remove `AnnotationFileLoader`, use `AttributeFileLoader` instead
1012

1113
6.4
1214
---

src/Symfony/Component/Routing/Loader/AnnotationDirectoryLoader.php

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)