Skip to content

Conversation

@yottalogical
Copy link
Contributor

Follow-up to #1796. I realized there were a few more ways I could make the typing for iterator_to_array more accurate.

  • Bound TKey to int|string, since array keys are always an int or a string
  • Allow the $iterator parameter to be an array (allowed since PHP 8.2)
  • Use a conditional return type based on $preserve_keys

Docs for iterator_to_array

@yottalogical
Copy link
Contributor Author

1) StubTests\StubsTypeHintsTest::testSignatureTypeHintsConformPhpDocInFunctions@function \iterator_to_array with data ('\iterator_to_array')
Function \iterator_to_array has mismatch in phpdoc return type and signature return type. 
            Signature has array but phpdoc has mixed

The return type in the PHPDoc isn't actually mixed, but it is using a conditional return type, which may be throwing off the tests. Would someone be able to advise me on what I should do here?

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.

1 participant