mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -15,15 +15,11 @@ use Chill\MainBundle\DataFixtures\ORM\LoadUsers;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\PersonBundle\DataFixtures\Helper\PersonRandomHelper;
|
||||
use Chill\PersonBundle\Entity\Relationships\Relationship;
|
||||
use DateTimeImmutable;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
|
||||
use function array_key_exists;
|
||||
use function count;
|
||||
|
||||
class LoadRelationships extends Fixture implements DependentFixtureInterface
|
||||
{
|
||||
use PersonRandomHelper;
|
||||
@@ -45,12 +41,12 @@ class LoadRelationships extends Fixture implements DependentFixtureInterface
|
||||
|
||||
for ($i = 0; 20 > $i; ++$i) {
|
||||
$user = $this->getRandomUser();
|
||||
$date = new DateTimeImmutable();
|
||||
$date = new \DateTimeImmutable();
|
||||
$relationship = (new Relationship())
|
||||
->setFromPerson($this->getRandomPerson($this->em))
|
||||
->setToPerson($this->getRandomPerson($this->em))
|
||||
->setRelation($this->getReference(LoadRelations::RELATION_KEY .
|
||||
random_int(0, count(LoadRelations::RELATIONS) - 1)))
|
||||
->setRelation($this->getReference(LoadRelations::RELATION_KEY.
|
||||
random_int(0, \count(LoadRelations::RELATIONS) - 1)))
|
||||
->setReverse((bool) random_int(0, 1))
|
||||
->setCreatedBy($user)
|
||||
->setUpdatedBy($user)
|
||||
@@ -63,7 +59,7 @@ class LoadRelationships extends Fixture implements DependentFixtureInterface
|
||||
max($relationship->getFromPerson()->getId(), $relationship->getToPerson()->getId()),
|
||||
];
|
||||
|
||||
if (array_key_exists($set[0], $existing) && array_key_exists($set[1], $existing[$set[0]])) {
|
||||
if (\array_key_exists($set[0], $existing) && \array_key_exists($set[1], $existing[$set[0]])) {
|
||||
continue;
|
||||
}
|
||||
$existing[$set[0]][$set[1]] = 1;
|
||||
|
Reference in New Issue
Block a user