Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Fix Calls to count() #97

Merged
merged 20 commits into from
Mar 27, 2018
Merged

Fix Calls to count() #97

merged 20 commits into from
Mar 27, 2018

Conversation

bbatsche
Copy link
Contributor

Description

Add logic and checks to avoid passing null to count() and make sure that any classes with a public count() method implement Countable interface.

Fixed Issues (if relevant)

  1. Warning: count(): Parameter must be an array or an object that implements Countable #7: Warning: count(): Parameter must be an array or an object that implements Countable

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@bbatsche bbatsche requested a review from buskamuza March 19, 2018 20:30
Copy link
Contributor

@buskamuza buskamuza left a comment

Choose a reason for hiding this comment

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

Please run builds and fix issues with count()

@@ -9,6 +9,7 @@
*/
namespace Magento\Test\Bootstrap;

ob_start();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@joanhe Is there a reason for this? I feel like it definitely does not belong here

Copy link

@joanhe joanhe Mar 22, 2018

Choose a reason for hiding this comment

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

@bbatsche This is to resolve test failure in php 7.2.
session_id(): Cannot change session id when headers already sent in

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe try adding this right above the call that's failing, or somewhere in one of the setUp*() methods. No code or function calls should be in this file and not inside of the class itself.

Copy link

Choose a reason for hiding this comment

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

This is the only place works.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants