mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-27 17:15:02 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -16,18 +16,13 @@ use Chill\MainBundle\DataFixtures\ORM\LoadPostalCodes;
|
||||
use Chill\MainBundle\Entity\Address;
|
||||
use Chill\MainBundle\Entity\PostalCode;
|
||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||
use DateTimeImmutable;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Iterator;
|
||||
use libphonenumber\PhoneNumberUtil;
|
||||
use Nelmio\Alice\Loader\NativeLoader;
|
||||
use Nelmio\Alice\ObjectSet;
|
||||
|
||||
use function array_map;
|
||||
use function count;
|
||||
|
||||
class LoadThirdParty extends Fixture implements DependentFixtureInterface
|
||||
{
|
||||
private readonly PhoneNumberUtil $phoneNumberUtil;
|
||||
@@ -54,7 +49,7 @@ class LoadThirdParty extends Fixture implements DependentFixtureInterface
|
||||
// this is an address
|
||||
continue;
|
||||
}
|
||||
$thirdParty->setCreatedAt(new DateTimeImmutable('today'));
|
||||
$thirdParty->setCreatedAt(new \DateTimeImmutable('today'));
|
||||
|
||||
foreach ($this->getCenters() as $center) {
|
||||
$thirdParty->addCenter($center);
|
||||
@@ -66,13 +61,13 @@ class LoadThirdParty extends Fixture implements DependentFixtureInterface
|
||||
$manager->flush();
|
||||
}
|
||||
|
||||
private function getCenters(): Iterator
|
||||
private function getCenters(): \Iterator
|
||||
{
|
||||
$references = array_map(
|
||||
$references = \array_map(
|
||||
static fn ($a) => $a['ref'],
|
||||
LoadCenters::$centers
|
||||
);
|
||||
$number = random_int(1, count($references));
|
||||
$number = random_int(1, \count($references));
|
||||
|
||||
if (1 === $number) {
|
||||
yield $this->getReference($references[array_rand($references)]);
|
||||
|
Reference in New Issue
Block a user