[Routing] Fix incomplete warning about multiple PHP classes in the same file#22028
[Routing] Fix incomplete warning about multiple PHP classes in the same file#22028OskarStark wants to merge 1 commit intosymfony:6.4from
Conversation
There was a problem hiding this comment.
Pull request overview
This PR attempts to expand a warning in the routing documentation about defining multiple PHP classes in the same file. The change adds information about route attribute priority over other configuration formats.
Changes:
- Added two sentences to an existing warning explaining that route attributes always take priority over routes defined in YAML, XML, or PHP configuration files
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| routes of the first class, ignoring all the other routes. The route attribute | ||
| always wins over routes defined in YAML, XML or PHP files and Symfony will | ||
| always load the route attribute. |
There was a problem hiding this comment.
The added sentences are confusing and don't logically connect to the warning's main topic. The warning starts by discussing the issue of multiple PHP classes in the same file, but then abruptly shifts to discussing route priority between different configuration formats (attributes vs YAML/XML/PHP). These are two separate concepts that need clarification. Additionally, the phrase "The route attribute always wins over routes defined in YAML, XML or PHP files and Symfony will always load the route attribute" is redundant and unclear - saying attributes "win" and are "always loaded" conveys the same idea twice. Consider either removing these sentences or clearly explaining how route format priority relates to the multiple-classes-per-file issue.
| routes of the first class, ignoring all the other routes. The route attribute | |
| always wins over routes defined in YAML, XML or PHP files and Symfony will | |
| always load the route attribute. | |
| routes of the first class, ignoring all the other routes. |
| routes of the first class, ignoring all the other routes. The route attribute | ||
| always wins over routes defined in YAML, XML or PHP files and Symfony will | ||
| always load the route attribute. |
There was a problem hiding this comment.
The phrase "The route attribute" is ambiguous. It's unclear whether this refers to route attributes in general (as a configuration format) or specifically to route attributes in the context of multiple classes in one file. Consider using more precise language such as "Routes defined with attributes" to make it clear you're referring to the attribute-based routing format.
| routes of the first class, ignoring all the other routes. The route attribute | |
| always wins over routes defined in YAML, XML or PHP files and Symfony will | |
| always load the route attribute. | |
| routes of the first class, ignoring all the other routes. Routes defined with | |
| attributes always take precedence over routes defined in YAML, XML or PHP files | |
| and Symfony will always load the attribute-based routes. |
No description provided.