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

CompanyFixtures::load()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 14
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 18
rs 9.7998
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