Skip to content

Improve get_comment() return type extension#148

Merged
szepeviktor merged 1 commit intoszepeviktor:masterfrom
IanDelMar:getcomment
Feb 24, 2023
Merged

Improve get_comment() return type extension#148
szepeviktor merged 1 commit intoszepeviktor:masterfrom
IanDelMar:getcomment

Conversation

@IanDelMar
Copy link
Copy Markdown
Contributor

This PR

  • improves the dynamic return type extension for get_comment() by also checking the first argument and removing the null type if applicable,
  • replaces the deprecated $type instanceof ConstantStringType,
  • adds tests for the first argument being an instance of WP_Comment and for the no argument case.

@szepeviktor
Copy link
Copy Markdown
Owner

Thank you @IanDelMar!

This looks very professional.

@szepeviktor szepeviktor merged commit 318f106 into szepeviktor:master Feb 24, 2023
@IanDelMar IanDelMar deleted the getcomment branch February 25, 2023 01:25
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