-
Notifications
You must be signed in to change notification settings - Fork 185
[TASK] Modernize cObject "USER" examples #1327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TASK] Modernize cObject "USER" examples #1327
Conversation
- Avoid GeneralUtility::makeInstance(), use DI instead (has to be set public therefore) - Use newly introduced request attribute to retrieve current page ID as best practise - Add request where missing as argument and improve docblock - Streamline namespace to be in line with other examples Releases: main
['header'], | ||
'tt_content', | ||
['pid' => (int)$GLOBALS['TSFE']->id], | ||
// The request attribute 'frontend.page.information' has been introduced |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would mention such information in the text not as a coment in the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was by intention: Then it is to far away from the context. Ppl tend to just copy/paste without reading text above or below the code snippet. So, they copy the comment with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If they copy this comment they start wondering what a version switch is as they are then not in the context of the docs anymore
* @param array TypoScript configuration | ||
* @param string Empty string (no content to process) | ||
* @param array TypoScript configuration | ||
* @param ServerRequestInterface $request The current PSR-7 request object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment contains no information beyond what the FQN would give you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It also does not harm, Maybe not everyone knows what a ServerRequestInterface is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have 2 request objects in TYPO3. The original TYPO3 Request also known als TYPO3_REQUEST and the Extbase Request (which is dying with each further TYPO3 version). What about:
* @param ServerRequestInterface $request The current PSR-7 request object | |
* @param ServerRequestInterface $request The TYPO3 request object |
Abandoned. Someone feel free to pick it up again. |
Releases: main