Skip to content

Commit 2105980

Browse files
committed
fix the upgrade instructions and trigger deprecations
1 parent a2a47bc commit 2105980

File tree

3 files changed

+76
-50
lines changed

3 files changed

+76
-50
lines changed

UPGRADE-7.3.md

Lines changed: 54 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -79,29 +79,31 @@ FrameworkBundle
7979
* The XML routing configuration files (`errors.xml` and `webhook.xml`) are
8080
deprecated, use their PHP equivalent ones:
8181

82-
*Before*
83-
```yaml
84-
when@dev:
85-
_errors:
86-
resource: '@FrameworkBundle/Resources/config/routing/errors.xml'
87-
prefix: /_error
82+
Before:
8883

89-
webhook:
90-
resource: '@FrameworkBundle/Resources/config/routing/webhook.xml'
91-
prefix: /webhook
92-
```
84+
```yaml
85+
when@dev:
86+
_errors:
87+
resource: '@FrameworkBundle/Resources/config/routing/errors.xml'
88+
prefix: /_error
9389

94-
*After*
95-
```yaml
96-
when@dev:
97-
_errors:
98-
resource: '@FrameworkBundle/Resources/config/routing/errors.php'
99-
prefix: /_error
90+
webhook:
91+
resource: '@FrameworkBundle/Resources/config/routing/webhook.xml'
92+
prefix: /webhook
93+
```
94+
95+
After:
10096
101-
webhook:
102-
resource: '@FrameworkBundle/Resources/config/routing/webhook.php'
103-
prefix: /webhook
104-
```
97+
```yaml
98+
when@dev:
99+
_errors:
100+
resource: '@FrameworkBundle/Resources/config/routing/errors.php'
101+
prefix: /_error
102+
103+
webhook:
104+
resource: '@FrameworkBundle/Resources/config/routing/webhook.php'
105+
prefix: /webhook
106+
```
105107
106108
HttpFoundation
107109
--------------
@@ -139,36 +141,6 @@ PropertyInfo
139141
* Deprecate the `PropertyTypeExtractorInterface::getTypes()` method, use `PropertyTypeExtractorInterface::getType()` instead
140142
* Deprecate the `ConstructorArgumentTypeExtractorInterface::getTypesFromConstructor()` method, use `ConstructorArgumentTypeExtractorInterface::getTypeFromConstructor()` instead
141143

142-
Routing
143-
-------
144-
145-
* The XML routing configuration files (`profiler.xml` and `wdt.xml`) are
146-
deprecated, use their PHP equivalent ones:
147-
148-
*Before*
149-
```yaml
150-
when@dev:
151-
web_profiler_wdt:
152-
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml'
153-
prefix: /_wdt
154-
155-
web_profiler_profiler:
156-
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
157-
prefix: /_profiler
158-
```
159-
160-
*After*
161-
```yaml
162-
when@dev:
163-
web_profiler_wdt:
164-
resource: '@WebProfilerBundle/Resources/config/routing/wdt.php'
165-
prefix: /_wdt
166-
167-
web_profiler_profiler:
168-
resource: '@WebProfilerBundle/Resources/config/routing/profiler.php
169-
prefix: /_profiler
170-
```
171-
172144
Security
173145
--------
174146

@@ -307,6 +279,38 @@ VarExporter
307279
* Deprecate `LazyGhostTrait` and `LazyProxyTrait`, use native lazy objects instead
308280
* Deprecate `ProxyHelper::generateLazyGhost()`, use native lazy objects instead
309281

282+
WebProfilerBundle
283+
-----------------
284+
285+
* The XML routing configuration files (`profiler.xml` and `wdt.xml`) are
286+
deprecated, use their PHP equivalent ones:
287+
288+
Before:
289+
290+
```yaml
291+
when@dev:
292+
web_profiler_wdt:
293+
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml'
294+
prefix: /_wdt
295+
296+
web_profiler_profiler:
297+
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
298+
prefix: /_profiler
299+
```
300+
301+
After:
302+
303+
```yaml
304+
when@dev:
305+
web_profiler_wdt:
306+
resource: '@WebProfilerBundle/Resources/config/routing/wdt.php'
307+
prefix: /_wdt
308+
309+
web_profiler_profiler:
310+
resource: '@WebProfilerBundle/Resources/config/routing/profiler.php
311+
prefix: /_profiler
312+
```
313+
310314
Workflow
311315
--------
312316

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,19 @@
1010
*/
1111

1212
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
13+
use Symfony\Component\Routing\Loader\XmlFileLoader;
1314

1415
return function (RoutingConfigurator $routes): void {
16+
foreach (debug_backtrace() as $trace) {
17+
if (isset($trace['object']) && $trace['object'] instanceof XmlFileLoader && 'doImport' === $trace['function']) {
18+
if (__DIR__ === dirname(realpath($trace['args'][3]))) {
19+
trigger_deprecation('symfony/routing', '7.3', 'The "errors.xml" routing configuration file is deprecated, import "errors.php" instead.');
20+
21+
break;
22+
}
23+
}
24+
}
25+
1526
$routes->add('_preview_error', '/{code}.{_format}')
1627
->controller('error_controller::preview')
1728
->defaults(['_format' => 'html'])

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,19 @@
1010
*/
1111

1212
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
13+
use Symfony\Component\Routing\Loader\XmlFileLoader;
1314

1415
return function (RoutingConfigurator $routes): void {
16+
foreach (debug_backtrace() as $trace) {
17+
if (isset($trace['object']) && $trace['object'] instanceof XmlFileLoader && 'doImport' === $trace['function']) {
18+
if (__DIR__ === dirname(realpath($trace['args'][3]))) {
19+
trigger_deprecation('symfony/routing', '7.3', 'The "webhook.xml" routing configuration file is deprecated, import "webhook.php" instead.');
20+
21+
break;
22+
}
23+
}
24+
}
25+
1526
$routes->add('_webhook_controller', '/{type}')
1627
->controller('webhook_controller::handle')
1728
->requirements(['type' => '.+'])

0 commit comments

Comments
 (0)