mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-31 03:53:49 +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)]);
|
||||
|
@@ -41,7 +41,7 @@ class LoadThirdPartyCategory extends Fixture implements FixtureGroupInterface
|
||||
];
|
||||
|
||||
foreach ($categories as $val) {
|
||||
echo 'Creating thirdparty category : ' . $val['name']['fr'] . "\n";
|
||||
echo 'Creating thirdparty category : '.$val['name']['fr']."\n";
|
||||
$category = (new ThirdPartyCategory())
|
||||
->setName($val['name'])
|
||||
->setActive(true);
|
||||
|
@@ -39,7 +39,7 @@ class LoadThirdPartyProfession extends Fixture implements FixtureGroupInterface
|
||||
];
|
||||
|
||||
foreach ($professions as $val) {
|
||||
echo 'Creating thirdparty professions : ' . $val['name']['fr'] . "\n";
|
||||
echo 'Creating thirdparty professions : '.$val['name']['fr']."\n";
|
||||
$profession = (new ThirdPartyProfession())
|
||||
->setName($val['name'])
|
||||
->setActive(true);
|
||||
|
Reference in New Issue
Block a user