- début refonte graphique

- début MangaDbProvider
This commit is contained in:
Jérémy Guillot
2024-06-05 00:05:28 +02:00
parent 2f9ff7facb
commit 9595831aa3
23 changed files with 607 additions and 515 deletions

View File

@@ -4,6 +4,7 @@ namespace App\Factory;
use App\Entity\Manga;
use App\Repository\MangaRepository;
use Symfony\Component\String\Slugger\SluggerInterface;
use Zenstruck\Foundry\ModelFactory;
use Zenstruck\Foundry\Proxy;
use Zenstruck\Foundry\RepositoryProxy;
@@ -34,7 +35,7 @@ final class MangaFactory extends ModelFactory
*
* @todo inject services if required
*/
public function __construct()
public function __construct(private SluggerInterface $slugger)
{
parent::__construct();
}
@@ -46,9 +47,11 @@ final class MangaFactory extends ModelFactory
*/
protected function getDefaults(): array
{
$title = self::faker()->words(rand(1, 3), true);
return [
'slug' => self::faker()->text(255),
'title' => self::faker()->text(255),
'slug' => $this->slugger->slug($title)->lower(),
'title' => $title,
];
}