refactor: supprimer tout le code legacy MVC/Twig/Stimulus
Supprime toutes les couches pré-DDD pour ne garder que l'architecture hexagonale (src/Domain/), les entités Doctrine et le front Vue.js SPA. Supprimé : - src/Controller/ (9 controllers Twig, garde SecurityController) - src/Service/, src/Message/, src/MessageHandler/ (services et messages legacy) - src/Manager/, src/Twig/, src/Form/ (UI legacy) - src/Event/, src/EventListener/, src/EventSubscriber/QueueStatusSubscriber - src/Client/MangadexClient.php (doublon du Domain) - src/Interface/, src/Factory/, src/DataFixtures/, src/Scheduler/MainSchedule - templates/ (tous sauf vue/ et base retiré — SecurityController = pur JSON) - assets/controllers/ (20 Stimulus controllers), app.js, bootstrap.js, controllers.json Modifié : - config/routes.yaml : suppression du chargement des controllers legacy - config/packages/messenger.yaml : suppression des routes legacy - config/services.yaml : suppression des bindings legacy + entrées Domain\Import fantômes - webpack.config.js : suppression entry 'app' et enableStimulusBridge - src/Entity/Chapter.php : suppression #[Broadcast] (Turbo Streams legacy) Déplacé : - src/Factory/*.php → tests/Factory/ (namespace App\Tests\Factory)
This commit is contained in:
parent
d7e6bf56d0
commit
5a0888eb28
75
tests/Factory/ChapterFactory.php
Normal file
75
tests/Factory/ChapterFactory.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace App\Tests\Factory;
|
||||
|
||||
use App\Entity\Chapter;
|
||||
use App\Repository\ChapterRepository;
|
||||
use Zenstruck\Foundry\ModelFactory;
|
||||
use Zenstruck\Foundry\Proxy;
|
||||
use Zenstruck\Foundry\RepositoryProxy;
|
||||
|
||||
/**
|
||||
* @extends ModelFactory<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 = [])
|
||||
*/
|
||||
final class ChapterFactory extends ModelFactory
|
||||
{
|
||||
/**
|
||||
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#factories-as-services
|
||||
*
|
||||
* @todo inject services if required
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#model-factories
|
||||
*
|
||||
* @todo add your default values here
|
||||
*/
|
||||
protected function getDefaults(): array
|
||||
{
|
||||
return [
|
||||
'manga' => MangaFactory::new(),
|
||||
'number' => self::faker()->randomFloat(2, 0, 999),
|
||||
'volume' => self::faker()->optional()->numberBetween(1, 100),
|
||||
'title' => self::faker()->optional()->sentence(3),
|
||||
'localPath' => self::faker()->optional()->filePath(),
|
||||
'externalId' => self::faker()->optional()->uuid(),
|
||||
'cbzPath' => self::faker()->optional()->filePath(),
|
||||
'visible' => true,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#initialization
|
||||
*/
|
||||
protected function initialize(): self
|
||||
{
|
||||
return $this
|
||||
// ->afterInstantiate(function(Chapter $chapter): void {})
|
||||
;
|
||||
}
|
||||
|
||||
protected static function getClass(): string
|
||||
{
|
||||
return Chapter::class;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user