Skip to content

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Aug 20, 2021

@@ -11696,7 +11696,7 @@
'str_replace' => ['string|array', 'search'=>'string|array', 'replace'=>'string|array', 'subject'=>'string|array', '&w_replace_count='=>'int'],
'str_rot13' => ['string', 'str'=>'string'],
'str_shuffle' => ['string', 'str'=>'string'],
'str_split' => ['array<int,string>|false', 'str'=>'string', 'split_length='=>'int'],
'str_split' => ['array<int,string>|false', 'str'=>'string', 'split_length='=>'positive-int'],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

str_split always returns a non-empty array.. I tried adding this here, but it seems the &nonEmpty signature doesn't work from this file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since maybe controversial, put it into a separate PR:
#632

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The correct is 'non-empty-array<int,string>|false'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh makes sense.. #633

@ondrejmirtes ondrejmirtes merged commit 15a0ff0 into phpstan:master Aug 20, 2021
@ondrejmirtes
Copy link
Member

Thank you.

@staabm staabm deleted the positive-split-length branch August 20, 2021 11:17
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