Skip to content

PHP 7.2 compatibility fix #1104

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

Merged
merged 1 commit into from
Oct 12, 2017
Merged

PHP 7.2 compatibility fix #1104

merged 1 commit into from
Oct 12, 2017

Conversation

tamcy
Copy link
Contributor

@tamcy tamcy commented Oct 12, 2017

Starting from PHP 7.2 a warning will be thrown when calling count() against non-countable objects.

This pull request attempts to fix a case where count() is called on a non-countable object -
\EXSyst\Component\Swagger\Collections\Responses is not an array and doesn't implements Countable. Given it implements Traversable, the counting code is changed from count() to iterator_count().

While the title states it as a compatibility fix, I suspect this also fixes a hidden bug.

@GuilhemN GuilhemN merged commit 3e98b9f into nelmio:master Oct 12, 2017
@GuilhemN
Copy link
Collaborator

Thank you @tamcy!

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.

None yet

2 participants