Skip to content

Introduce dynamic return type for the get_approved_comments function#211

Merged
szepeviktor merged 1 commit intoszepeviktor:masterfrom
lipemat:feature/get_approved_comments
Feb 23, 2024
Merged

Introduce dynamic return type for the get_approved_comments function#211
szepeviktor merged 1 commit intoszepeviktor:masterfrom
lipemat:feature/get_approved_comments

Conversation

@lipemat
Copy link
Copy Markdown
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
Copy Markdown
Owner

Thank you.

@szepeviktor szepeviktor merged commit 6bbffec into szepeviktor:master Feb 23, 2024
@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