Debug Magento 2 via PhpStorm + xdebug 3, code works but fails during debugging only

There is no strange exception when I debug via Eclipse or just run pages from browser. But when I debug via Phpstorm I met strange exception:

1 exception(s):
Exception #0 (Exception): Objects returned by Bss\ShoppingCartRulePerStoreView\Model\ResourceModel\Rule\Collection\Interceptor::getIterator() must be traversable or implement interface Iterator

It method:

/**
* Implementation of \IteratorAggregate::getIterator()
*
* @return \ArrayIterator
*/
public function getIterator()
{
$this->load();
return new \ArrayIterator($this->_items);
}

And it throws exception on $this->load(); line. It method is in the parent class.

I found that there aren't exceptions when I'm not stepping to these classes, but It's not good solution for me, because Eclipse works fine with these classes.

Why it happens and how I can resolve it?

Debug log: https://drive.google.com/file/d/15qASQ_kQ_fhP2s35y342tPzRymhbKoA9/view?usp=sharing

1 comment
Comment actions Permalink

I Updated phpstorm to 2022.2.1 and updated xdebug to 3.1.2 and problem gone.

0

Please sign in to leave a comment.