Skip to content
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] Add trait providing standard implementation of Commentable #1206

Merged
merged 4 commits into from
Mar 25, 2025

Conversation

JakeQZ
Copy link
Contributor

@JakeQZ JakeQZ commented Mar 21, 2025

Resolves #813.

@coveralls
Copy link

coveralls commented Mar 21, 2025

Coverage Status

coverage: 52.257% (+0.2%) from 52.048%
when pulling 65bb1e7 on task/commentable-trait
into ece5633 on main.

@JakeQZ JakeQZ force-pushed the task/commentable-trait branch 2 times, most recently from c3f5699 to aacf98b Compare March 22, 2025 01:20
@JakeQZ JakeQZ force-pushed the task/commentable-trait branch from aacf98b to fa0e11c Compare March 22, 2025 19:40
*
* @dataProvider provideCommentArray
*/
public function getCommentsAfterEmptyArrayOfCommentsAddedReturnsOriginalComments(array $comments): void
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can describe the effects instead of focusing on the methods:

Suggested change
public function getCommentsAfterEmptyArrayOfCommentsAddedReturnsOriginalComments(array $comments): void
public function setCommentsWithEmptyArrayKeepsOriginalCommentsUnchanged(array $comments): void

Copy link
Contributor Author

@JakeQZ JakeQZ Mar 25, 2025

Choose a reason for hiding this comment

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

Apart from getCommentsInitiallyReturnsEmptyArray(), all the test methods focus on either addComments() (first group) or setComments() (last group). So perhaps they all be renamed like addCommentsDoesXYZ() and setCommentsDoesXYZ - WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I'd like that!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@JakeQZ JakeQZ force-pushed the task/commentable-trait branch from a0631c6 to c202639 Compare March 25, 2025 04:03
@oliverklee
Copy link
Contributor

oliverklee commented Mar 25, 2025

There's a leftover use (which PHP-CS-Fixer is complaining about), and also one open comment.

@JakeQZ JakeQZ force-pushed the task/commentable-trait branch from c202639 to 94a17b4 Compare March 25, 2025 18:48
@JakeQZ
Copy link
Contributor Author

JakeQZ commented Mar 25, 2025

There's a leftover use (which PHP-CS-Fixer is complaining about), and also one open comment.

I've replied to the open comment with a question. I've fixed the leftover use - I'd forgotton to do git add before amending the commit.

In most cases this is either `addComments` or `setComments`,
rather than `getComments`.
@JakeQZ JakeQZ requested a review from oliverklee March 25, 2025 19:21
@oliverklee oliverklee merged commit ee07bde into main Mar 25, 2025
21 checks passed
@oliverklee oliverklee deleted the task/commentable-trait branch March 25, 2025 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add trait for 'standard' Commentable implementation
3 participants