[Documentation:Developer] Update php route info#766
Open
roye2 wants to merge 4 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why is this Change Important & Necessary?
The documentation concerning Routes was outdated. The old syntax of
@Route(...)is deprecated and in fact will no longer work with the recent update to the Route object we include from Symfony in PR #12935.New Additions
Instances of
@Route(...)have been replaced with#[Route(...)]to match what will be expected from developers when writing PHP code.Screenshots
Before
After
Other information
Unfortunately, the markdown renderer thinks the #[Route(...)] syntax is a comment due to the leading #. If at some point GitHub pages updates their markdown renderer to allow for PHP 8 syntax highlighting then the Routes will appear correctly as uncommented.


Example of how it is now:
Here is how it actually looks in the code:
Notice how the routes are not italicized.
This is not really a big deal but it kind of annoys me that the routes look like they are comments. However, I think that is better than rendering these code blocks as plain text or a different language than php (both of which would make the route appear 'correctly').
Also, the example given of UserController on the Controller / View pages is code that no longer exists in the submitty codebase. It is still a good example of how to write our php code but at some point we should probably update the example to use real code.