Completed
Push — Recipes ( c0466a...7632b6 )
by Laurent
04:22
created

LoadAppData   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 21
dl 0
loc 45
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A load() 0 28 1
A getOrder() 0 3 1
1
<?php
2
/**
3
 * LoadAppData Données de l'application GLSR.
4
 *
5
 * PHP Version 7
6
 *
7
 * @author    Quétier Laurent <[email protected]>
8
 * @copyright 2018 Dev-Int GLSR
9
 * @license   http://opensource.org/licenses/gpl-license.php GNU Public License
10
 *
11
 * @version GIT: $Id$
12
 *
13
 * @see https://github.com/Dev-Int/glsr
14
 */
15
16
namespace App\DataFixtures\ORM;
17
18
use Doctrine\Common\DataFixtures\AbstractFixture;
19
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
20
use Doctrine\Common\Persistence\ObjectManager;
21
use App\Entity\Settings\Company;
22
use App\Entity\Settings\Settings;
23
24
/**
25
 * LoadApp Data.
26
 *
27
 * @category DataFixtures
28
 */
29
class LoadAppData extends AbstractFixture implements OrderedFixtureInterface
30
{
31
    /**
32
     * Load data fixtures with the passed EntityManager.
33
     *
34
     * @param ObjectManager $manager
35
     */
36
    public function load(ObjectManager $manager)
37
    {
38
        $phoneUtil = \libphonenumber\PhoneNumberUtil::getInstance();
39
40
        // Load Company
41
        $app = new Company();
42
        $app->setName('Dev-Int')
43
            ->setStatus('S.A.R.L.')
44
            ->setAddress('2, rue de la chèvre')
45
            ->setZipCode('75000')
46
            ->setTown('Paris')
47
            ->setPhone($phoneUtil->parse('0140000000', 'FR'))
48
            ->setFax($phoneUtil->parse('0140000000', 'FR'))
49
            ->setMail('[email protected]')
0 ignored issues
show
Bug introduced by
The method setMail() does not exist on App\Entity\Settings\Company. Did you maybe mean setEmail()? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

49
            ->/** @scrutinizer ignore-call */ setMail('[email protected]')

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
50
            ->setContact('Ursule')
51
            ->setGsm($phoneUtil->parse('0640000000', 'FR'));
52
53
        $manager->persist($app);
54
55
        // Load Settings
56
        $settings = new Settings();
57
        $settings->setInventoryStyle('zonestorage')
58
            ->setCalculation('weighted')
59
            ->setCurrency('EUR');
60
61
        $manager->persist($settings);
62
63
        $manager->flush();
64
    }
65
66
    /**
67
     * Get the order of this fixture.
68
     *
69
     * @return int
70
     */
71
    public function getOrder()
72
    {
73
        return 3;
74
    }
75
}
76