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

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

Merged
merged 4 commits into from
Feb 26, 2023

Conversation

IanDelMar
Copy link
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.

Co-authored-by: Viktor Szépe <[email protected]>
@szepeviktor szepeviktor merged commit d0c7100 into szepeviktor:master Feb 26, 2023
@szepeviktor
Copy link
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