-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat: Add OCP interface to format richtext into string #48137
Conversation
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
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.
Nice one 👍
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
$replacements = []; | ||
foreach ($parameters as $placeholder => $parameter) { | ||
$placeholders[] = '{' . $placeholder . '}'; | ||
foreach (['name','type'] as $requiredField) { |
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.
foreach (['name','type'] as $requiredField) { | |
foreach (['name', 'type'] as $requiredField) { |
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.
why is this not covered by cs-fixed? 👀
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.
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.
Why would it be broken?
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.
Because this change is not flagged an cs error
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.
But do we have a rule for this?
The code @nickvergessen mentioned is only there to ignore git-ignored files.
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 is an array, not a function call so a space is not expected there I think
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.
But I agree that we should have a rule for it.
/** | ||
* @since 31.0.0 | ||
* @param string $message | ||
* @param array<string,array<string,string>> $parameters |
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.
* @param array<string,array<string,string>> $parameters | |
* @param array<string, array<string, string>> $parameters |
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’m always afraid to break tools by doing that because the type and the name of the parameter is space separated to adding space in the type looks wrong.
Otherwise good and looking forward to it |
Summary
Adds an interface into OCP to format richtext into a string, fixing a code duplication from activity, notifications and setupchecks.
Solves this TODO:
server/core/Command/SetupChecks.php
Line 33 in f8dde2d
Checklist