Next major version 2 with PHP 8.1, Symfony 6, Tabler UI, 2FA ... (#2902)

This commit is contained in:
Kevin Papst
2022-12-31 21:19:55 +01:00
committed by GitHub
parent 95e06746bd
commit 90a0fd8a22
2164 changed files with 83700 additions and 86426 deletions

View File

@@ -23,17 +23,13 @@ use Faker\Factory;
*
* @codeCoverageIgnore
*/
class TagFixtures extends Fixture
final class TagFixtures extends Fixture
{
public const MIN_TAGS = 50;
public const MAX_TAGS = 2000;
public const BATCH_SIZE = 100;
/**
* {@inheritdoc}
*/
public function load(ObjectManager $manager)
public function load(ObjectManager $manager): void
{
$faker = Factory::create();
$amount = rand(self::MIN_TAGS, self::MAX_TAGS);
@@ -43,18 +39,18 @@ class TagFixtures extends Fixture
$tag = new Tag();
$tagName = null;
if ($i % 18 == 0) {
$tagName = $faker->firstName;
} elseif ($i % 7 == 0) {
$tagName = $faker->lastName;
} elseif ($i % 5 == 0) {
$tagName = $faker->city;
} elseif ($i % 4 == 0) {
$tagName = $faker->word;
} elseif ($i % 3 == 0) {
$tagName = $faker->streetName;
} elseif ($i % 2 == 0) {
$tagName = $faker->colorName;
if ($i % 18 === 0) {
$tagName = $faker->firstName();
} elseif ($i % 7 === 0) {
$tagName = $faker->lastName();
} elseif ($i % 5 === 0) {
$tagName = $faker->city();
} elseif ($i % 4 === 0) {
$tagName = $faker->word();
} elseif ($i % 3 === 0) {
$tagName = $faker->streetName();
} elseif ($i % 2 === 0) {
$tagName = $faker->colorName();
} else {
$tagName = $faker->text(rand(5, 10));
}
@@ -70,10 +66,10 @@ class TagFixtures extends Fixture
if ($i % self::BATCH_SIZE === 0) {
$manager->flush();
$manager->clear(Tag::class);
$manager->clear();
}
}
$manager->flush();
$manager->clear(Tag::class);
$manager->clear();
}
}