-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -2,18 +2,21 @@ | |||||
|
||||||
declare(strict_types=1); | ||||||
|
||||||
namespace Vendor\SitePackage\UserFunctions; | ||||||
namespace MyVendor\SitePackage\UserFunctions; | ||||||
|
||||||
use Psr\Http\Message\ServerRequestInterface; | ||||||
|
||||||
final class Hostname | ||||||
{ | ||||||
/** | ||||||
* Return standard host name for the local machine | ||||||
* | ||||||
* @param string Empty string (no content to process) | ||||||
* @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 commentThe 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 commentThe 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 commentThe 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:
Suggested change
|
||||||
* @return string HTML result | ||||||
*/ | ||||||
public function getHostname(string $content, array $conf): string | ||||||
public function getHostname(string $content, array $conf, ServerRequestInterface $request): string | ||||||
{ | ||||||
return gethostname() ?: ''; | ||||||
} | ||||||
|
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