Commit bdec2a9b authored by Alex Ne's avatar Alex Ne

count(): Parameter must be an array or an object that implements Countable

parent 8d0af8cb
...@@ -125,7 +125,10 @@ class ECollection implements \IteratorAggregate, \ArrayAccess, \Countable { ...@@ -125,7 +125,10 @@ class ECollection implements \IteratorAggregate, \ArrayAccess, \Countable {
public function offsetSet($offset, $object) { public function offsetSet($offset, $object) {
$this->__check_type($object); $this->__check_type($object);
$offset = $object->getHash(); $offset = $object->getHash();
if (count($object->getContext()) > 0 || ! isset($this->context_collection[$offset])) { if (is_object($object->getContext()) ||
(is_array($object->getContext()) && count($object->getContext()) > 0) ||
! isset($this->context_collection[$offset]))
{
$this->context_collection[$offset][] = $object->getContext(); $this->context_collection[$offset][] = $object->getContext();
$object->clean_context(); $object->clean_context();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment