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

WP/PostsPerPage: simplification #2265

Merged
merged 1 commit into from
Jun 26, 2023

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Jun 25, 2023

The WPCS AbstractArrayAssignmentRestrictionsSniff expects an array from getGroups() which includes a 'message' key. The callback() method subsequently allows to override that message with a higher priority message if needed in specific circumstances.

This sniff, however, doesn't need to override the message, so the callback() method can just use the default behaviour of returning true or false and use the 'message' as declared in the group.

The WPCS `AbstractArrayAssignmentRestrictionsSniff` expects an array from `getGroups()` which includes a `'message'` key.
The `callback()` method subsequently allows to override that message with a higher priority message if needed in specific circumstances.

This sniff, however, doesn't need to override the message, so the `callback()` method can just use the default behaviour of returning `true` or `false` and use the `'message'` as declared in the group.
Copy link
Member

@GaryJones GaryJones left a comment

Choose a reason for hiding this comment

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

@GaryJones GaryJones merged commit 7ab5947 into develop Jun 26, 2023
35 checks passed
@GaryJones GaryJones deleted the feature/postsperpage-simplification branch June 26, 2023 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants