Skip to content

Conversation

@come-nc
Copy link
Contributor

@come-nc come-nc commented Sep 17, 2024

  • Resolves: #

Summary

Adds an interface into OCP to format richtext into a string, fixing a code duplication from activity, notifications and setupchecks.
Solves this TODO:

* @TODO move this method to a common service used by notifications, activity and this command

Checklist

@come-nc come-nc added enhancement 3. to review Waiting for reviews pending documentation This pull request needs an associated documentation update labels Sep 17, 2024
@come-nc come-nc added this to the Nextcloud 31 milestone Sep 17, 2024
@come-nc come-nc requested review from a team, nickvergessen and susnux September 17, 2024 12:00
@come-nc come-nc self-assigned this Sep 17, 2024
@come-nc come-nc requested review from artonge, provokateurin and sorbaugh and removed request for a team September 17, 2024 12:00
Copy link
Member

@provokateurin provokateurin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one 👍

$replacements = [];
foreach ($parameters as $placeholder => $parameter) {
$placeholders[] = '{' . $placeholder . '}';
foreach (['name','type'] as $requiredField) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
foreach (['name','type'] as $requiredField) {
foreach (['name', 'type'] as $requiredField) {

Copy link
Contributor

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? 👀

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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?

Copy link
Contributor

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

Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @param array<string,array<string,string>> $parameters
* @param array<string, array<string, string>> $parameters

Copy link
Contributor Author

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.

@nickvergessen
Copy link
Member

Otherwise good and looking forward to it

@come-nc come-nc merged commit 989d708 into master Sep 18, 2024
@come-nc come-nc deleted the enh/add-rich-object-formatter branch September 18, 2024 16:59
@skjnldsv skjnldsv mentioned this pull request Jan 7, 2025
@come-nc come-nc removed the pending documentation This pull request needs an associated documentation update label Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants