Completed
Pull Request — master (#26)
by Valentyn
02:41
created

GenresFixtures   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 14
c 0
b 0
f 0
wmc 1
lcom 0
cbo 4
ccs 0
cts 8
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 11 1
1
<?php
2
3
namespace App\Genres\DataFixtures;
4
5
use App\Genres\Entity\Genre;
6
use App\Genres\Entity\GenreTranslations;
7
use Doctrine\Bundle\FixturesBundle\Fixture;
8
use Doctrine\Common\Persistence\ObjectManager;
9
10
class GenresFixtures extends Fixture
11
{
12
    public function load(ObjectManager $manager): void
13
    {
14
        $comedy = new Genre();
15
        $comedy
16
            ->addTranslation(new GenreTranslations($comedy, 'en', 'Comedy'))
17
            ->addTranslation(new GenreTranslations($comedy, 'uk', 'Комедія'))
18
            ->addTranslation(new GenreTranslations($comedy, 'ru', 'Комедия'));
19
20
        $manager->persist($comedy);
21
        $manager->flush();
22
    }
23
}