LoadVariableData   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 66
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 66
ccs 42
cts 42
cp 1
rs 10
c 2
b 1
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 63 1
1
<?php
2
3
namespace AppBundle\DataFixtures\ORM;
4
5
use Doctrine\Common\DataFixtures\FixtureInterface;
6
use Doctrine\Common\Persistence\ObjectManager;
7
use AppBundle\Entity\Variable;
8
9
class LoadVariableData implements FixtureInterface
10
{
11 6
    public function load(ObjectManager $manager)
12
    {
13 6
        $variable = new Variable();
14
15 6
        $variable->setName('temperature');
16 6
        $variable->setDescription('test temperature metric');
17 6
        $variable->setSource('internal');
18 6
        $variable->setParser('Simple');
19 6
        $variable->setValue('20');
20
21 6
        $variable->needHistory = true;
22
23 6
        $manager->persist($variable);
24
25
26 6
        $variable = new Variable();
27
28 6
        $variable->setName('humidity');
29 6
        $variable->setDescription('test humidity metric');
30 6
        $variable->setSource('internal');
31 6
        $variable->setParser('Argument');
32 6
        $variable->setValue('70');
33
34 6
        $variable->needHistory = true;
35
36 6
        $manager->persist($variable);
37
38 6
        $variable = new Variable();
39
40 6
        $variable->setName('internet.upload');
41 6
        $variable->setDescription('test humidity metric');
42 6
        $variable->setSource('internal');
43 6
        $variable->setParser('Argument');
44 6
        $variable->setValue('70');
45
46 6
        $manager->persist($variable);
47
48 6
        $variable = new Variable();
49
50 6
        $variable->setName('internet.download');
51 6
        $variable->setDescription('test humidity metric');
52 6
        $variable->setSource('internal');
53 6
        $variable->setParser('Argument');
54 6
        $variable->setValue('70');
55
56 6
        $variable->needHistory = true;
57
58 6
        $manager->persist($variable);
59
60 6
        $variable = new Variable();
61
62 6
        $variable->setName('internet.ping');
63 6
        $variable->setDescription('test humidity metric');
64 6
        $variable->setSource('internal');
65 6
        $variable->setParser('Argument');
66 6
        $variable->setValue('70');
67 6
        $variable->needHistory = true;
68
69 6
        $manager->persist($variable);
70
71
72 6
        $manager->flush();
73 6
    }
74
}
75