Sylius version affected: 1.3
Description
I executed php bin/console sylius:install and threw the following error

The problem appeared in SyliusLabs\AssociationHydrator\AssociationHydrator line 77:
array_unique($subjects, \SORT_REGULAR)
The $subjects is array of Sylius\Component\Core\Model\Promotion:

However, other properties associated with Promotion such as PromotionCouponInterface, PromotionRuleInterface, and PromotionActionInterface cause circular reference problems when using array_unique.
Steps to reproduce
$ composer create-project sylius/sylius-standard acme
$ cd acme
$ php bin/console sylius:install
Possible Solution
Use other methods to detect if $subjects is unique?
My php version: php7.3.0
Related links: https://bugs.php.net/bug.php?id=39356
I reproduced this situation:
<?php
class A
{
private $b;
public function setB(B $b)
{
$this->b = $b;
}
}
class B
{
private $a = [];
public function addA(A $a)
{
$a->setB($this);
$this->a[] = $a;
}
}
$b1 = new B();
$b1->addA(new A());
$b2 = new B();
$b2->addA(new A());
$collection = [$b1, $b2];
$result = array_unique($collection, \SORT_REGULAR);
var_dump($result);
in php 7.3.0, the Fatal error has been throw!
Fatal error: Nesting level too deep - recursive dependency?
Reproduced on a clean install under PHP 7.3. After resolving the "continue" warning in Gaufrette, the Circular reference appears.
vendor/sylius-labs/association-hydrator/src/AssociationHydrator.php:77
It was fixed here, we will release a new version of this library asap and it should not be a problem anymore :)
AssociationHydrator v1.1.1 has just been released.
Most helpful comment
AssociationHydrator v1.1.1 has just been released.