Passed
Push — develop ( 7d2e81...61e6f0 )
by Laurent
06:22 queued 03:53
created

CompanyFixtures::load()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 14
nc 1
nop 1
dl 0
loc 18
rs 9.7998
c 0
b 0
f 0
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 Administration\Infrastructure\DataFixtures;
15
16
use Administration\Domain\Company\Model\Company;
17
use Core\Domain\Common\Model\VO\ContactUuid;
18
use Core\Domain\Common\Model\VO\EmailField;
19
use Core\Domain\Common\Model\VO\NameField;
20
use Core\Domain\Common\Model\VO\PhoneField;
21
use Doctrine\Bundle\FixturesBundle\Fixture;
22
use Doctrine\Bundle\FixturesBundle\FixtureGroupInterface;
23
use Doctrine\Persistence\ObjectManager;
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