apply more cs rules for php-cs

This commit is contained in:
2023-10-17 13:27:03 +02:00
parent 0b0cbed9db
commit bc2041cbdd
1485 changed files with 8169 additions and 9620 deletions

View File

@@ -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)]);

View File

@@ -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);

View File

@@ -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);