ActionFixture   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 18
ccs 0
cts 11
cp 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A load() 0 11 1
A getGroups() 0 3 1
1
<?php
2
3
namespace App\DataFixtures;
4
5
use App\Entity\Game\Action;
6
use Doctrine\Bundle\FixturesBundle\Fixture;
7
use Doctrine\Persistence\ObjectManager;
8
use Doctrine\Bundle\FixturesBundle\FixtureGroupInterface;
9
10
class ActionFixture extends Fixture implements FixtureGroupInterface
11
{
12
    public function load(ObjectManager $manager): void
13
    {
14
        $action = new Action();
15
        $action->setType('use');
16
        $action->setDescription('You use the sword.');
17
        $action->setId(44);
18
        $action->setRequiredLocationId(11);
19
        $action->setItemId(99);
20
        $manager->persist($action);
21
22
        $manager->flush();
23
    }
24
25
    public static function getGroups(): array
26
    {
27
        return ['group1'];
28
    }
29
}
30