feat: migrer vers Symfony 8, PHP 8.4 et les dépendances majeures associées

- PHP 8.3 → 8.4 (Dockerfile + composer.json)
- Symfony 7.0 → 8.0 (tous les composants symfony/*)
- API Platform 3.x → 4.x : migration openapiContext → openapi: new Operation(...)
- Doctrine DBAL 3 → 4 : suppression use_savepoints, replace prepare/executeQuery
- Doctrine ORM 2.x → 3.x : ClassMetadataInfo → ClassMetadata, setParameters → setParameter
- Doctrine Bundle 2.x → 3.x, Fixtures Bundle 3.x → 4.x
- zenstruck/foundry 1.x → 2.x : ModelFactory → PersistentObjectFactory, getDefaults → defaults
- phpmd/phpmd 2.x → 3.x-dev (seule version supportant Symfony 8)
- phparkitect 0.3 → 0.8 : NotDependsOnTheseNamespaces prend un array
- symfony/mercure-bundle 0.3 → 0.4, symfony/monolog-bundle 3 → 4
- Suppression de runtime/frankenphp-symfony (intégré nativement dans symfony/runtime 8)
- worker.Caddyfile : suppression de APP_RUNTIME (détection automatique Symfony 8)
- Routes errors.xml/wdt.xml/profiler.xml → .php (Symfony 8 supprime le XML)
- Types::ARRAY → Types::JSON dans Entity/Manga.php (DBAL 4 retire array type)
- Suppression de src/Schedule.php (doublon vide avec MonitoringSchedule)
- Tests : hydra:Collection → Collection, hydra:member → member (API Platform 4)
This commit is contained in:
ext.jeremy.guillot@maxicoffee.domains
2026-03-26 17:55:12 +01:00
parent 5a0888eb28
commit 5ed303612a
371 changed files with 6194 additions and 4160 deletions

View File

@@ -4,30 +4,29 @@ namespace App\Tests\Factory;
use App\Entity\ApiToken;
use App\Repository\ApiTokenRepository;
use Zenstruck\Foundry\ModelFactory;
use Zenstruck\Foundry\Proxy;
use Zenstruck\Foundry\RepositoryProxy;
use Zenstruck\Foundry\Persistence\PersistentObjectFactory;
use Zenstruck\Foundry\Persistence\RepositoryDecorator;
/**
* @extends ModelFactory<ApiToken>
* @extends PersistentObjectFactory<ApiToken>
*
* @method ApiToken|Proxy create(array|callable $attributes = [])
* @method static ApiToken|Proxy createOne(array $attributes = [])
* @method static ApiToken|Proxy find(object|array|mixed $criteria)
* @method static ApiToken|Proxy findOrCreate(array $attributes)
* @method static ApiToken|Proxy first(string $sortedField = 'id')
* @method static ApiToken|Proxy last(string $sortedField = 'id')
* @method static ApiToken|Proxy random(array $attributes = [])
* @method static ApiToken|Proxy randomOrCreate(array $attributes = [])
* @method static ApiTokenRepository|RepositoryProxy repository()
* @method static ApiToken[]|Proxy[] all()
* @method static ApiToken[]|Proxy[] createMany(int $number, array|callable $attributes = [])
* @method static ApiToken[]|Proxy[] createSequence(iterable|callable $sequence)
* @method static ApiToken[]|Proxy[] findBy(array $attributes)
* @method static ApiToken[]|Proxy[] randomRange(int $min, int $max, array $attributes = [])
* @method static ApiToken[]|Proxy[] randomSet(int $number, array $attributes = [])
* @method ApiToken create(array|callable $attributes = [])
* @method static ApiToken createOne(array $attributes = [])
* @method static ApiToken find(object|array|mixed $criteria)
* @method static ApiToken findOrCreate(array $attributes)
* @method static ApiToken first(string $sortedField = 'id')
* @method static ApiToken last(string $sortedField = 'id')
* @method static ApiToken random(array $attributes = [])
* @method static ApiToken randomOrCreate(array $attributes = [])
* @method static ApiTokenRepository&RepositoryDecorator repository()
* @method static list<ApiToken> all()
* @method static list<ApiToken> createMany(int $number, array|callable $attributes = [])
* @method static list<ApiToken> createSequence(iterable|callable $sequence)
* @method static list<ApiToken> findBy(array $attributes)
* @method static list<ApiToken> randomRange(int $min, int $max, array $attributes = [])
* @method static list<ApiToken> randomSet(int $number, array $attributes = [])
*/
final class ApiTokenFactory extends ModelFactory
final class ApiTokenFactory extends PersistentObjectFactory
{
/**
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#factories-as-services
@@ -39,12 +38,17 @@ final class ApiTokenFactory extends ModelFactory
parent::__construct();
}
public static function class(): string
{
return ApiToken::class;
}
/**
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#model-factories
*
* @todo add your default values here
*/
protected function getDefaults(): array
protected function defaults(): array
{
return [
'ownedBy' => UserFactory::new(),
@@ -55,15 +59,10 @@ final class ApiTokenFactory extends ModelFactory
/**
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#initialization
*/
protected function initialize(): self
protected function initialize(): static
{
return $this
// ->afterInstantiate(function(ApiToken $apiToken): void {})
;
}
protected static function getClass(): string
{
return ApiToken::class;
}
}

View File

@@ -4,30 +4,29 @@ namespace App\Tests\Factory;
use App\Entity\Chapter;
use App\Repository\ChapterRepository;
use Zenstruck\Foundry\ModelFactory;
use Zenstruck\Foundry\Proxy;
use Zenstruck\Foundry\RepositoryProxy;
use Zenstruck\Foundry\Persistence\PersistentObjectFactory;
use Zenstruck\Foundry\Persistence\RepositoryDecorator;
/**
* @extends ModelFactory<Chapter>
* @extends PersistentObjectFactory<Chapter>
*
* @method Chapter|Proxy create(array|callable $attributes = [])
* @method static Chapter|Proxy createOne(array $attributes = [])
* @method static Chapter|Proxy find(object|array|mixed $criteria)
* @method static Chapter|Proxy findOrCreate(array $attributes)
* @method static Chapter|Proxy first(string $sortedField = 'id')
* @method static Chapter|Proxy last(string $sortedField = 'id')
* @method static Chapter|Proxy random(array $attributes = [])
* @method static Chapter|Proxy randomOrCreate(array $attributes = [])
* @method static ChapterRepository|RepositoryProxy repository()
* @method static Chapter[]|Proxy[] all()
* @method static Chapter[]|Proxy[] createMany(int $number, array|callable $attributes = [])
* @method static Chapter[]|Proxy[] createSequence(iterable|callable $sequence)
* @method static Chapter[]|Proxy[] findBy(array $attributes)
* @method static Chapter[]|Proxy[] randomRange(int $min, int $max, array $attributes = [])
* @method static Chapter[]|Proxy[] randomSet(int $number, array $attributes = [])
* @method Chapter create(array|callable $attributes = [])
* @method static Chapter createOne(array $attributes = [])
* @method static Chapter find(object|array|mixed $criteria)
* @method static Chapter findOrCreate(array $attributes)
* @method static Chapter first(string $sortedField = 'id')
* @method static Chapter last(string $sortedField = 'id')
* @method static Chapter random(array $attributes = [])
* @method static Chapter randomOrCreate(array $attributes = [])
* @method static ChapterRepository&RepositoryDecorator repository()
* @method static list<Chapter> all()
* @method static list<Chapter> createMany(int $number, array|callable $attributes = [])
* @method static list<Chapter> createSequence(iterable|callable $sequence)
* @method static list<Chapter> findBy(array $attributes)
* @method static list<Chapter> randomRange(int $min, int $max, array $attributes = [])
* @method static list<Chapter> randomSet(int $number, array $attributes = [])
*/
final class ChapterFactory extends ModelFactory
final class ChapterFactory extends PersistentObjectFactory
{
/**
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#factories-as-services
@@ -39,12 +38,17 @@ final class ChapterFactory extends ModelFactory
parent::__construct();
}
public static function class(): string
{
return Chapter::class;
}
/**
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#model-factories
*
* @todo add your default values here
*/
protected function getDefaults(): array
protected function defaults(): array
{
return [
'manga' => MangaFactory::new(),
@@ -61,15 +65,10 @@ final class ChapterFactory extends ModelFactory
/**
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#initialization
*/
protected function initialize(): self
protected function initialize(): static
{
return $this
// ->afterInstantiate(function(Chapter $chapter): void {})
;
}
protected static function getClass(): string
{
return Chapter::class;
}
}

View File

@@ -4,42 +4,46 @@ namespace App\Tests\Factory;
use App\Entity\Manga;
use App\Repository\MangaRepository;
use Zenstruck\Foundry\ModelFactory;
use Zenstruck\Foundry\Proxy;
use Zenstruck\Foundry\RepositoryProxy;
use Zenstruck\Foundry\Persistence\PersistentObjectFactory;
use Zenstruck\Foundry\Persistence\RepositoryDecorator;
/**
* @extends ModelFactory<Manga>
* @extends PersistentObjectFactory<Manga>
*
* @method Manga|Proxy create(array|callable $attributes = [])
* @method static Manga|Proxy createOne(array $attributes = [])
* @method static Manga|Proxy find(object|array|mixed $criteria)
* @method static Manga|Proxy findOrCreate(array $attributes)
* @method static Manga|Proxy first(string $sortedField = 'id')
* @method static Manga|Proxy last(string $sortedField = 'id')
* @method static Manga|Proxy random(array $attributes = [])
* @method static Manga|Proxy randomOrCreate(array $attributes = [])
* @method static MangaRepository|RepositoryProxy repository()
* @method static Manga[]|Proxy[] all()
* @method static Manga[]|Proxy[] createMany(int $number, array|callable $attributes = [])
* @method static Manga[]|Proxy[] createSequence(iterable|callable $sequence)
* @method static Manga[]|Proxy[] findBy(array $attributes)
* @method static Manga[]|Proxy[] randomRange(int $min, int $max, array $attributes = [])
* @method static Manga[]|Proxy[] randomSet(int $number, array $attributes = [])
* @method Manga create(array|callable $attributes = [])
* @method static Manga createOne(array $attributes = [])
* @method static Manga find(object|array|mixed $criteria)
* @method static Manga findOrCreate(array $attributes)
* @method static Manga first(string $sortedField = 'id')
* @method static Manga last(string $sortedField = 'id')
* @method static Manga random(array $attributes = [])
* @method static Manga randomOrCreate(array $attributes = [])
* @method static MangaRepository&RepositoryDecorator repository()
* @method static list<Manga> all()
* @method static list<Manga> createMany(int $number, array|callable $attributes = [])
* @method static list<Manga> createSequence(iterable|callable $sequence)
* @method static list<Manga> findBy(array $attributes)
* @method static list<Manga> randomRange(int $min, int $max, array $attributes = [])
* @method static list<Manga> randomSet(int $number, array $attributes = [])
*/
final class MangaFactory extends ModelFactory
final class MangaFactory extends PersistentObjectFactory
{
/**
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#factories-as-services
*
* @todo inject services if required
*/
public static function class(): string
{
return Manga::class;
}
/**
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#model-factories
*
* @todo add your default values here
*/
protected function getDefaults(): array
protected function defaults(): array
{
$title = self::faker()->words(rand(1, 3), true);
@@ -64,15 +68,10 @@ final class MangaFactory extends ModelFactory
/**
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#initialization
*/
protected function initialize(): self
protected function initialize(): static
{
return $this
// ->afterInstantiate(function(Manga $manga): void {})
;
}
protected static function getClass(): string
{
return Manga::class;
}
}

View File

@@ -4,30 +4,29 @@ namespace App\Tests\Factory;
use App\Entity\Page;
use App\Repository\PageRepository;
use Zenstruck\Foundry\ModelFactory;
use Zenstruck\Foundry\Proxy;
use Zenstruck\Foundry\RepositoryProxy;
use Zenstruck\Foundry\Persistence\PersistentObjectFactory;
use Zenstruck\Foundry\Persistence\RepositoryDecorator;
/**
* @extends ModelFactory<Page>
* @extends PersistentObjectFactory<Page>
*
* @method Page|Proxy create(array|callable $attributes = [])
* @method static Page|Proxy createOne(array $attributes = [])
* @method static Page|Proxy find(object|array|mixed $criteria)
* @method static Page|Proxy findOrCreate(array $attributes)
* @method static Page|Proxy first(string $sortedField = 'id')
* @method static Page|Proxy last(string $sortedField = 'id')
* @method static Page|Proxy random(array $attributes = [])
* @method static Page|Proxy randomOrCreate(array $attributes = [])
* @method static PageRepository|RepositoryProxy repository()
* @method static Page[]|Proxy[] all()
* @method static Page[]|Proxy[] createMany(int $number, array|callable $attributes = [])
* @method static Page[]|Proxy[] createSequence(iterable|callable $sequence)
* @method static Page[]|Proxy[] findBy(array $attributes)
* @method static Page[]|Proxy[] randomRange(int $min, int $max, array $attributes = [])
* @method static Page[]|Proxy[] randomSet(int $number, array $attributes = [])
* @method Page create(array|callable $attributes = [])
* @method static Page createOne(array $attributes = [])
* @method static Page find(object|array|mixed $criteria)
* @method static Page findOrCreate(array $attributes)
* @method static Page first(string $sortedField = 'id')
* @method static Page last(string $sortedField = 'id')
* @method static Page random(array $attributes = [])
* @method static Page randomOrCreate(array $attributes = [])
* @method static PageRepository&RepositoryDecorator repository()
* @method static list<Page> all()
* @method static list<Page> createMany(int $number, array|callable $attributes = [])
* @method static list<Page> createSequence(iterable|callable $sequence)
* @method static list<Page> findBy(array $attributes)
* @method static list<Page> randomRange(int $min, int $max, array $attributes = [])
* @method static list<Page> randomSet(int $number, array $attributes = [])
*/
final class PageFactory extends ModelFactory
final class PageFactory extends PersistentObjectFactory
{
/**
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#factories-as-services
@@ -39,12 +38,17 @@ final class PageFactory extends ModelFactory
parent::__construct();
}
public static function class(): string
{
return Page::class;
}
/**
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#model-factories
*
* @todo add your default values here
*/
protected function getDefaults(): array
protected function defaults(): array
{
return [
'chapter' => ChapterFactory::new(),
@@ -57,15 +61,10 @@ final class PageFactory extends ModelFactory
/**
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#initialization
*/
protected function initialize(): self
protected function initialize(): static
{
return $this
// ->afterInstantiate(function(Page $page): void {})
;
}
protected static function getClass(): string
{
return Page::class;
}
}

View File

@@ -4,30 +4,29 @@ namespace App\Tests\Factory;
use App\Entity\Source;
use App\Repository\SourceRepository;
use Zenstruck\Foundry\ModelFactory;
use Zenstruck\Foundry\Proxy;
use Zenstruck\Foundry\RepositoryProxy;
use Zenstruck\Foundry\Persistence\PersistentObjectFactory;
use Zenstruck\Foundry\Persistence\RepositoryDecorator;
/**
* @extends ModelFactory<Source>
* @extends PersistentObjectFactory<Source>
*
* @method Source|Proxy create(array|callable $attributes = [])
* @method static Source|Proxy createOne(array $attributes = [])
* @method static Source|Proxy find(object|array|mixed $criteria)
* @method static Source|Proxy findOrCreate(array $attributes)
* @method static Source|Proxy first(string $sortedField = 'id')
* @method static Source|Proxy last(string $sortedField = 'id')
* @method static Source|Proxy random(array $attributes = [])
* @method static Source|Proxy randomOrCreate(array $attributes = [])
* @method static SourceRepository|RepositoryProxy repository()
* @method static Source[]|Proxy[] all()
* @method static Source[]|Proxy[] createMany(int $number, array|callable $attributes = [])
* @method static Source[]|Proxy[] createSequence(iterable|callable $sequence)
* @method static Source[]|Proxy[] findBy(array $attributes)
* @method static Source[]|Proxy[] randomRange(int $min, int $max, array $attributes = [])
* @method static Source[]|Proxy[] randomSet(int $number, array $attributes = [])
* @method Source create(array|callable $attributes = [])
* @method static Source createOne(array $attributes = [])
* @method static Source find(object|array|mixed $criteria)
* @method static Source findOrCreate(array $attributes)
* @method static Source first(string $sortedField = 'id')
* @method static Source last(string $sortedField = 'id')
* @method static Source random(array $attributes = [])
* @method static Source randomOrCreate(array $attributes = [])
* @method static SourceRepository&RepositoryDecorator repository()
* @method static list<Source> all()
* @method static list<Source> createMany(int $number, array|callable $attributes = [])
* @method static list<Source> createSequence(iterable|callable $sequence)
* @method static list<Source> findBy(array $attributes)
* @method static list<Source> randomRange(int $min, int $max, array $attributes = [])
* @method static list<Source> randomSet(int $number, array $attributes = [])
*/
final class SourceFactory extends ModelFactory
final class SourceFactory extends PersistentObjectFactory
{
/**
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#factories-as-services
@@ -39,12 +38,17 @@ final class SourceFactory extends ModelFactory
parent::__construct();
}
public static function class(): string
{
return Source::class;
}
/**
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#model-factories
*
* @todo add your default values here
*/
protected function getDefaults(): array
protected function defaults(): array
{
return [
'name' => self::faker()->optional()->company(),
@@ -60,15 +64,10 @@ final class SourceFactory extends ModelFactory
/**
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#initialization
*/
protected function initialize(): self
protected function initialize(): static
{
return $this
// ->afterInstantiate(function(Source $source): void {})
;
}
protected static function getClass(): string
{
return Source::class;
}
}

View File

@@ -5,48 +5,50 @@ namespace App\Tests\Factory;
use App\Entity\User;
use App\Repository\UserRepository;
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
use Zenstruck\Foundry\ModelFactory;
use Zenstruck\Foundry\Proxy;
use Zenstruck\Foundry\RepositoryProxy;
use Zenstruck\Foundry\Persistence\PersistentObjectFactory;
use Zenstruck\Foundry\Persistence\RepositoryDecorator;
/**
* @extends ModelFactory<User>
* @extends PersistentObjectFactory<User>
*
* @method User|Proxy create(array|callable $attributes = [])
* @method static User|Proxy createOne(array $attributes = [])
* @method static User|Proxy find(object|array|mixed $criteria)
* @method static User|Proxy findOrCreate(array $attributes)
* @method static User|Proxy first(string $sortedField = 'id')
* @method static User|Proxy last(string $sortedField = 'id')
* @method static User|Proxy random(array $attributes = [])
* @method static User|Proxy randomOrCreate(array $attributes = [])
* @method static UserRepository|RepositoryProxy repository()
* @method static User[]|Proxy[] all()
* @method static User[]|Proxy[] createMany(int $number, array|callable $attributes = [])
* @method static User[]|Proxy[] createSequence(iterable|callable $sequence)
* @method static User[]|Proxy[] findBy(array $attributes)
* @method static User[]|Proxy[] randomRange(int $min, int $max, array $attributes = [])
* @method static User[]|Proxy[] randomSet(int $number, array $attributes = [])
* @method User create(array|callable $attributes = [])
* @method static User createOne(array $attributes = [])
* @method static User find(object|array|mixed $criteria)
* @method static User findOrCreate(array $attributes)
* @method static User first(string $sortedField = 'id')
* @method static User last(string $sortedField = 'id')
* @method static User random(array $attributes = [])
* @method static User randomOrCreate(array $attributes = [])
* @method static UserRepository&RepositoryDecorator repository()
* @method static list<User> all()
* @method static list<User> createMany(int $number, array|callable $attributes = [])
* @method static list<User> createSequence(iterable|callable $sequence)
* @method static list<User> findBy(array $attributes)
* @method static list<User> randomRange(int $min, int $max, array $attributes = [])
* @method static list<User> randomSet(int $number, array $attributes = [])
*/
final class UserFactory extends ModelFactory
final class UserFactory extends PersistentObjectFactory
{
public const array FIRST_NAMES = ["ALAIN", "ALEXANDRE", "ANDRÉ", "ANNIE", "ANTHONY", "AUDREY", "AURÉLIE", "BERNARD", "BRIGITTE", "BRUNO", "CATHERINE", "CEDRIC", "CHANTAL", "CHRISTELLE", "CHRISTIAN", "CHRISTIANE", "CHRISTINE", "CHRISTOPHE", "CLAUDE", "CORINNE", "CÉLINE", "DANIEL", "DANIELLE", "DAVID", "DENISE", "DIDIER", "DOMINIQUE", "ELODIE", "EMILIE", "ENZO", "ERIC", "FABRICE", "FLORENCE", "FRANCK", "FRANÇOISE", "FRÉDÉRIC", "GEORGES", "GERMAINE", "GUILLAUME", "GUY", "GÉRARD", "HENRI", "ISABELLE", "JACQUELINE", "JACQUES", "JEAN", "JEAN-CLAUDE", "JEAN-PIERRE", "JEANNE", "JEANNINE", "JEREMY", "JEROME", "JONATHAN", "JOSEPH", "JULIE", "JULIEN", "KARINE", "KEVIN", "LAETITIA", "LAURA", "LAURENCE", "LAURENT", "LOUIS", "LUCAS", "LÉA", "MADELEINE", "MANON", "MARCEL", "MARCELLE", "MARGUERITE", "MARIE", "MARINE", "MARTINE", "MAURICE", "MAXIME", "MICHEL", "MICHÈLE", "MONIQUE", "NATHALIE", "NICOLAS", "NICOLE", "ODETTE", "OLIVIER", "PASCAL", "PASCALE", "PATRICIA", "PATRICK", "PAUL", "PAULETTE", "PHILIPPE", "PIERRE", "RENÉ", "ROBERT", "ROGER", "ROMAIN", "SANDRA", "SANDRINE", "SERGE", "SOPHIE", "STÉPHANE", "STÉPHANIE", "SUZANNE", "SYLVIE", "SÉBASTIEN", "THIERRY", "THOMAS", "THÉO", "VALÉRIE", "VIRGINIE", "VÉRONIQUE", "YVETTE", "YVONNE"];
public const array LAST_NAMES = ["Adam", "Andre", "Antoine", "Arnaud", "Aubert", "Aubry", "Bailly", "Barbier", "Baron", "Barre", "Barthelemy", "Benard", "Benoit", "Berger", "Bernard", "Bertin", "Bertrand", "Besson", "Blanc", "Blanchard", "Bonnet", "Boucher", "Bouchet", "Boulanger", "Bourgeois", "Bouvier", "Boyer", "Breton", "Brun", "Brunet", "Carlier", "Caron", "Carpentier", "Carre", "Charles", "Charpentier", "Chauvin", "Chevalier", "Chevallier", "Clement", "Colin", "Collet", "Collin", "Cordier", "Cousin", "Da Silva", "Daniel", "David", "Delaunay", "Denis", "Deschamps", "Dubois", "Dufour", "Dumas", "Dumont", "Dupont", "Dupuis", "Dupuy", "Durand", "Duval", "Etienne", "Fabre", "Faure", "Fernandez", "Fleury", "Fontaine", "Fournier", "Francois", "Gaillard", "Garcia", "Garnier", "Gauthier", "Gautier", "Gay", "Gerard", "Germain", "Gilbert", "Gillet", "Girard", "Giraud", "Gonzalez", "Grondin", "Guerin", "Guichard", "Guillaume", "Guillot", "Guyot", "Hamon", "Henry", "Herve", "Hoarau", "Hubert", "Huet", "Humbert", "Jacob", "Jacquet", "Jean", "Joly", "Julien", "Klein", "Lacroix", "Lambert", "Lamy", "Langlois", "Laporte", "Laurent", "Le Gall", "Le Goff", "Le Roux", "Leblanc", "Lebrun", "Leclerc", "Leclercq", "Lecomte", "Lefebvre", "Lefevre", "Leger", "Legrand", "Lejeune", "Lemaire", "Lemaitre", "Lemoine", "Leroux", "Leroy", "Leveque", "Lopez", "Louis", "Lucas", "Maillard", "Mallet", "Marchal", "Marchand", "Marechal", "Marie", "Martin", "Martinez", "Marty", "Masson", "Mathieu", "Menard", "Mercier", "Meunier", "Meyer", "Michaud", "Michel", "Millet", "Monnier", "Moreau", "Morel", "Morin", "Moulin", "Muller", "Nicolas", "Noel", "Olivier", "Paris", "Pasquier", "Payet", "Pelletier", "Perez", "Perret", "Perrier", "Perrin", "Perrot", "Petit", "Philippe", "Picard", "Pichon", "Pierre", "Poirier", "Poulain", "Prevost", "Remy", "Renard", "Renaud", "Renault", "Rey", "Reynaud", "Richard", "Riviere", "Robert", "Robin", "Roche", "Rodriguez", "Roger", "Rolland", "Rousseau", "Roussel", "Roux", "Roy", "Royer", "Sanchez", "Schmitt", "Schneider", "Simon", "Tessier", "Thomas", "Vasseur", "Vidal", "Vincent", "Weber"];
public const array FIRST_NAMES = ['ALAIN', 'ALEXANDRE', 'ANDRÉ', 'ANNIE', 'ANTHONY', 'AUDREY', 'AURÉLIE', 'BERNARD', 'BRIGITTE', 'BRUNO', 'CATHERINE', 'CEDRIC', 'CHANTAL', 'CHRISTELLE', 'CHRISTIAN', 'CHRISTIANE', 'CHRISTINE', 'CHRISTOPHE', 'CLAUDE', 'CORINNE', 'CÉLINE', 'DANIEL', 'DANIELLE', 'DAVID', 'DENISE', 'DIDIER', 'DOMINIQUE', 'ELODIE', 'EMILIE', 'ENZO', 'ERIC', 'FABRICE', 'FLORENCE', 'FRANCK', 'FRANÇOISE', 'FRÉDÉRIC', 'GEORGES', 'GERMAINE', 'GUILLAUME', 'GUY', 'GÉRARD', 'HENRI', 'ISABELLE', 'JACQUELINE', 'JACQUES', 'JEAN', 'JEAN-CLAUDE', 'JEAN-PIERRE', 'JEANNE', 'JEANNINE', 'JEREMY', 'JEROME', 'JONATHAN', 'JOSEPH', 'JULIE', 'JULIEN', 'KARINE', 'KEVIN', 'LAETITIA', 'LAURA', 'LAURENCE', 'LAURENT', 'LOUIS', 'LUCAS', 'LÉA', 'MADELEINE', 'MANON', 'MARCEL', 'MARCELLE', 'MARGUERITE', 'MARIE', 'MARINE', 'MARTINE', 'MAURICE', 'MAXIME', 'MICHEL', 'MICHÈLE', 'MONIQUE', 'NATHALIE', 'NICOLAS', 'NICOLE', 'ODETTE', 'OLIVIER', 'PASCAL', 'PASCALE', 'PATRICIA', 'PATRICK', 'PAUL', 'PAULETTE', 'PHILIPPE', 'PIERRE', 'RENÉ', 'ROBERT', 'ROGER', 'ROMAIN', 'SANDRA', 'SANDRINE', 'SERGE', 'SOPHIE', 'STÉPHANE', 'STÉPHANIE', 'SUZANNE', 'SYLVIE', 'SÉBASTIEN', 'THIERRY', 'THOMAS', 'THÉO', 'VALÉRIE', 'VIRGINIE', 'VÉRONIQUE', 'YVETTE', 'YVONNE'];
public const array LAST_NAMES = ['Adam', 'Andre', 'Antoine', 'Arnaud', 'Aubert', 'Aubry', 'Bailly', 'Barbier', 'Baron', 'Barre', 'Barthelemy', 'Benard', 'Benoit', 'Berger', 'Bernard', 'Bertin', 'Bertrand', 'Besson', 'Blanc', 'Blanchard', 'Bonnet', 'Boucher', 'Bouchet', 'Boulanger', 'Bourgeois', 'Bouvier', 'Boyer', 'Breton', 'Brun', 'Brunet', 'Carlier', 'Caron', 'Carpentier', 'Carre', 'Charles', 'Charpentier', 'Chauvin', 'Chevalier', 'Chevallier', 'Clement', 'Colin', 'Collet', 'Collin', 'Cordier', 'Cousin', 'Da Silva', 'Daniel', 'David', 'Delaunay', 'Denis', 'Deschamps', 'Dubois', 'Dufour', 'Dumas', 'Dumont', 'Dupont', 'Dupuis', 'Dupuy', 'Durand', 'Duval', 'Etienne', 'Fabre', 'Faure', 'Fernandez', 'Fleury', 'Fontaine', 'Fournier', 'Francois', 'Gaillard', 'Garcia', 'Garnier', 'Gauthier', 'Gautier', 'Gay', 'Gerard', 'Germain', 'Gilbert', 'Gillet', 'Girard', 'Giraud', 'Gonzalez', 'Grondin', 'Guerin', 'Guichard', 'Guillaume', 'Guillot', 'Guyot', 'Hamon', 'Henry', 'Herve', 'Hoarau', 'Hubert', 'Huet', 'Humbert', 'Jacob', 'Jacquet', 'Jean', 'Joly', 'Julien', 'Klein', 'Lacroix', 'Lambert', 'Lamy', 'Langlois', 'Laporte', 'Laurent', 'Le Gall', 'Le Goff', 'Le Roux', 'Leblanc', 'Lebrun', 'Leclerc', 'Leclercq', 'Lecomte', 'Lefebvre', 'Lefevre', 'Leger', 'Legrand', 'Lejeune', 'Lemaire', 'Lemaitre', 'Lemoine', 'Leroux', 'Leroy', 'Leveque', 'Lopez', 'Louis', 'Lucas', 'Maillard', 'Mallet', 'Marchal', 'Marchand', 'Marechal', 'Marie', 'Martin', 'Martinez', 'Marty', 'Masson', 'Mathieu', 'Menard', 'Mercier', 'Meunier', 'Meyer', 'Michaud', 'Michel', 'Millet', 'Monnier', 'Moreau', 'Morel', 'Morin', 'Moulin', 'Muller', 'Nicolas', 'Noel', 'Olivier', 'Paris', 'Pasquier', 'Payet', 'Pelletier', 'Perez', 'Perret', 'Perrier', 'Perrin', 'Perrot', 'Petit', 'Philippe', 'Picard', 'Pichon', 'Pierre', 'Poirier', 'Poulain', 'Prevost', 'Remy', 'Renard', 'Renaud', 'Renault', 'Rey', 'Reynaud', 'Richard', 'Riviere', 'Robert', 'Robin', 'Roche', 'Rodriguez', 'Roger', 'Rolland', 'Rousseau', 'Roussel', 'Roux', 'Roy', 'Royer', 'Sanchez', 'Schmitt', 'Schneider', 'Simon', 'Tessier', 'Thomas', 'Vasseur', 'Vidal', 'Vincent', 'Weber'];
/**
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#factories-as-services
*
*/
public function __construct(private readonly UserPasswordHasherInterface $passwordHasher)
{
parent::__construct();
}
public static function class(): string
{
return User::class;
}
/**
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#model-factories
*
*/
protected function getDefaults(): array
protected function defaults(): array
{
return [
'email' => self::faker()->unique()->email(),
@@ -60,7 +62,7 @@ final class UserFactory extends ModelFactory
/**
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#initialization
*/
protected function initialize(): self
protected function initialize(): static
{
return $this
->afterInstantiate(function (User $user): void {
@@ -71,9 +73,4 @@ final class UserFactory extends ModelFactory
})
;
}
protected static function getClass(): string
{
return User::class;
}
}