Skip to content

Narrow type on assertCount to non-empty-* #204

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

Closed
michalbundyra opened this issue Feb 22, 2024 · 3 comments
Closed

Narrow type on assertCount to non-empty-* #204

michalbundyra opened this issue Feb 22, 2024 · 3 comments

Comments

@michalbundyra
Copy link
Contributor

As noted here #54 (comment)

Assert::assertCount(1, $array);

Not sure if it is possible to implement narrowing type to non-empty-* here.
This would be very helpful, so we do not need to add assertNotEmpty assertion.

Thanks

@ondrejmirtes
Copy link
Member

Yeah, we can rewrite that to count($array) === 1.

@michalbundyra
Copy link
Contributor Author

Done via d5242a5

Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants