ConnectionFixture::load()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 10
ccs 0
cts 8
cp 0
crap 2
rs 10
1
<?php
2
3
namespace App\DataFixtures;
4
5
use App\Entity\Game\Connection;
6
use Doctrine\Bundle\FixturesBundle\Fixture;
7
use Doctrine\Persistence\ObjectManager;
8
use Doctrine\Bundle\FixturesBundle\FixtureGroupInterface;
9
10
class ConnectionFixture extends Fixture implements FixtureGroupInterface
11
{
12
    public function load(ObjectManager $manager): void
13
    {
14
        $connection = new Connection();
15
        $connection->setFromLocationId(11);
16
        $connection->setToLocationId(22);
17
        $connection->setId(1);
18
        $connection->setDirection('north');
19
        $manager->persist($connection);
20
21
        $manager->flush();
22
    }
23
24
    public static function getGroups(): array
25
    {
26
        return ['group1'];
27
    }
28
}
29