LocationFixture::getGroups()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
namespace App\DataFixtures;
4
5
use App\Entity\Game\Location;
6
use Doctrine\Bundle\FixturesBundle\Fixture;
7
use Doctrine\Persistence\ObjectManager;
8
use Doctrine\Bundle\FixturesBundle\FixtureGroupInterface;
9
10
class LocationFixture extends Fixture implements FixtureGroupInterface
11
{
12
    public function load(ObjectManager $manager): void
13
    {
14
        $location = new Location();
15
        $location->setName('Mountain');
16
        $location->setDescription('A misty mountain.');
17
        $location->setDetails('The mountain is hidden in a vast sea of mist.');
18
        $location->setId(1);
19
        $manager->persist($location);
20
21
        $location1 = new Location();
22
        $location1->setName('Cave');
23
        $location1->setDescription('A dark cave.');
24
        $location1->setDetails('The cave is damp and cold.');
25
        $location1->setId(11);
26
        $manager->persist($location1);
27
28
        $location2 = new Location();
29
        $location2->setName('Lake');
30
        $location2->setDescription('A serene lake.');
31
        $location2->setDetails('A calm lake reflecting the beauty of its surroundings.');
32
        $location2->setId(22);
33
        $manager->persist($location2);
34
35
        $manager->flush();
36
    }
37
38
    public static function getGroups(): array
39
    {
40
        return ['group1'];
41
    }
42
}
43