Passed
Push — develop ( 229fa6...7d2e81 )
by Laurent
08:00 queued 04:20
created

CompanyFixtures   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 16
c 1
b 0
f 0
dl 0
loc 25
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A load() 0 18 1
A getGroups() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the G.L.S.R. Apps package.
7
 *
8
 * (c) Dev-Int Création <[email protected]>.
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Infrastructure\DataFixtures;
15
16
use Doctrine\Bundle\FixturesBundle\Fixture;
17
use Doctrine\Bundle\FixturesBundle\FixtureGroupInterface;
18
use Doctrine\Persistence\ObjectManager;
19
use Domain\Administration\Company\Model\Company;
20
use Domain\Common\Model\ContactUuid;
21
use Domain\Common\Model\VO\EmailField;
22
use Domain\Common\Model\VO\NameField;
23
use Domain\Common\Model\VO\PhoneField;
24
25
class CompanyFixtures extends Fixture implements FixtureGroupInterface
26
{
27
    final public function load(ObjectManager $manager): void
28
    {
29
        $company = Company::create(
30
            ContactUuid::fromString('a136c6fe-8f6e-45ed-91bc-586374791033'),
31
            NameField::fromString('Dev-Int Création'),
32
            '1 rue des ERP',
33
            '75000',
34
            'PARIS',
35
            'France',
36
            PhoneField::fromString('+33100000001'),
37
            PhoneField::fromString('+33100000002'),
38
            EmailField::fromString('[email protected]'),
39
            'Laurent',
40
            PhoneField::fromString('+33100000002')
41
        );
42
        $manager->persist($company);
43
44
        $manager->flush();
45
    }
46
47
    public static function getGroups(): array
48
    {
49
        return ['company'];
50
    }
51
}
52