Skip to content

Fix dynamic function return type extension for get_sites()#155

Merged
szepeviktor merged 4 commits intoszepeviktor:masterfrom
IanDelMar:get-sites
Feb 26, 2023
Merged

Fix dynamic function return type extension for get_sites()#155
szepeviktor merged 4 commits intoszepeviktor:masterfrom
IanDelMar:get-sites

Conversation

@IanDelMar
Copy link
Copy Markdown
Contributor

This PR

  • fixes the dynamic function return type extension for get_sites(),
  • adds correct tests,
  • bumps the required minimum version of PHPStan to 1.10.0 (needed for Type::getConstantScalarValues()),
  • removes deprecated instanceof.

What has been fixed?

  • There is no $args['fields'] = 'count' but $args['fields'] = 'ids' and $args['count']. The extension now checks for both $args['fields] and $args['count']. Not properly checking for 'count' led to incorrect return types for truthy count types.
  • A return type for indetermined argument type has been added.

Todo:

  • Adding tests for string parameter.

Comment thread src/GetSitesDynamicFunctionReturnTypeExtension.php Outdated
Co-authored-by: Viktor Szépe <[email protected]>
@szepeviktor szepeviktor merged commit d0c7100 into szepeviktor:master Feb 26, 2023
@szepeviktor
Copy link
Copy Markdown
Owner

Thank you Ian.

@IanDelMar IanDelMar deleted the get-sites branch February 26, 2023 02:40
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