Commit cb4d4a2
committed
minor symfony#65617 [FrameworkBundle] Suggest more packages for unknown commands (michaelthieulin)
This PR was merged into the 8.2 branch.
Discussion
----------
[FrameworkBundle] Suggest more packages for unknown commands
| Q | A
| ------------- | ---
| Branch? | 8.2
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Issues | Fix symfony#59459
| License | MIT
Following up on symfony#59472, closed with "please submit again when you want".
This applies the limit `@GromNaN` proposed and `@chalasr` agreed on there: only packages having a recipe in `symfony/recipes`, and only when they expose a command namespace no Symfony command already uses. That rules out five of the six bundles the previous attempt proposed, which live in `symfony/recipes-contrib` or have no recipe at all. The rule is written above the constant so the next person adding an entry knows where the line is, and an entry that stops qualifying can be dropped the way `sensio/generator-bundle` and `symfony/web-server-bundle` were.
Eight namespaces are added, plus `doctrine:migrations` and `make:admin` as subkeys of existing ones. Every name was checked against the `#[AsCommand]` names upstream.
A vendor publishing several bundles under one prefix only gets its own subkey: `lexik/maintenance-bundle` and `lexik/translation-bundle` also live under `lexik:`, so mapping the whole namespace to the JWT bundle would be wrong. Five of the new entries therefore have no `_default`, which the current code cannot express, as it reads `_default` without `isset()`. Hence the `?? null`. No existing namespace is affected, all three have a `_default`.
Commits
-------
69ecfb2 [FrameworkBundle] Suggest more packages for unknown commands2 files changed
+103-5Lines changed: 103 additions & 5 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- src/Symfony/Bundle/FrameworkBundle
- EventListener
- Tests/Console
Expand file treeCollapse file tree
Open diff view settings
Collapse file
src/Symfony/Bundle/FrameworkBundle/EventListener/SuggestMissingPackageSubscriber.php
Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/EventListener/SuggestMissingPackageSubscriber.php+43-5Lines changed: 43 additions & 5 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
26 | 26 | |
27 | 27 | |
28 | 28 | |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
29 | 35 | |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
30 | 46 | |
31 | 47 | |
| 48 | + |
32 | 49 | |
33 | 50 | |
34 | 51 | |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
35 | 61 | |
| 62 | + |
36 | 63 | |
37 | 64 | |
| 65 | + |
| 66 | + |
| 67 | + |
38 | 68 | |
39 | 69 | |
40 | 70 | |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
41 | 81 | |
42 | 82 | |
43 | 83 | |
| ||
52 | 92 | |
53 | 93 | |
54 | 94 | |
55 | | - |
| 95 | + |
56 | 96 | |
57 | | - |
58 | | - |
59 | | - |
60 | | - |
| 97 | + |
| 98 | + |
61 | 99 | |
62 | 100 | |
63 | 101 | |
|
Collapse file
src/Symfony/Bundle/FrameworkBundle/Tests/Console/ApplicationTest.php
Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Console/ApplicationTest.php+60Lines changed: 60 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
11 | 11 | |
12 | 12 | |
13 | 13 | |
| 14 | + |
14 | 15 | |
15 | 16 | |
16 | 17 | |
| ||
228 | 229 | |
229 | 230 | |
230 | 231 | |
| 232 | + |
| 233 | + |
| 234 | + |
| 235 | + |
| 236 | + |
| 237 | + |
| 238 | + |
| 239 | + |
| 240 | + |
| 241 | + |
| 242 | + |
| 243 | + |
| 244 | + |
| 245 | + |
| 246 | + |
| 247 | + |
| 248 | + |
| 249 | + |
| 250 | + |
| 251 | + |
| 252 | + |
| 253 | + |
| 254 | + |
| 255 | + |
| 256 | + |
| 257 | + |
| 258 | + |
| 259 | + |
| 260 | + |
| 261 | + |
| 262 | + |
| 263 | + |
| 264 | + |
| 265 | + |
| 266 | + |
| 267 | + |
| 268 | + |
| 269 | + |
| 270 | + |
| 271 | + |
| 272 | + |
| 273 | + |
| 274 | + |
| 275 | + |
| 276 | + |
| 277 | + |
| 278 | + |
| 279 | + |
| 280 | + |
| 281 | + |
| 282 | + |
| 283 | + |
| 284 | + |
| 285 | + |
| 286 | + |
| 287 | + |
| 288 | + |
| 289 | + |
| 290 | + |
231 | 291 | |
232 | 292 | |
233 | 293 | |
|
0 commit comments