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

Introduce dynamic return type for the get_approved_comments function #211

Merged
merged 1 commit into from
Feb 23, 2024
Merged

Introduce dynamic return type for the get_approved_comments function #211

merged 1 commit into from
Feb 23, 2024

Conversation

lipemat
Copy link
Contributor

@lipemat lipemat commented Feb 23, 2024

get_approved_comments changes the return type based on value within the passed $args parameter.

  • Return 'WP_Comment[]' by default.
  • Return int[] if $fields = 'ids'.
  • Return int if $count = true.

https://developer.wordpress.org/reference/functions/get_approved_comments/#return

`get_approved_comments` changes the return type based on value within the pass $args parameter.

- Return 'WP_Comment[]' by default.
- Return `int[]` if `$fields = 'ids'`.
- Return `int` if `$count = true`.
lipemat added a commit to lipemat/phpstan-wordpress that referenced this pull request Feb 23, 2024
@szepeviktor
Copy link
Owner

Thank you.

@szepeviktor szepeviktor merged commit 6bbffec into szepeviktor:master Feb 23, 2024
1 of 2 checks passed
@lipemat lipemat deleted the feature/get_approved_comments branch February 23, 2024 17:24
lipemat added a commit to lipemat/phpstan-wordpress that referenced this pull request Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants