Completed
Push — master ( a9d3b9...e09e3d )
by Kirill
03:27
created

LoadVariableData   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 66
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 66
ccs 0
cts 43
cp 0
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
    public function load(ObjectManager $manager)
12
    {
13
        $variable = new Variable();
14
15
        $variable->setName('temperature');
16
        $variable->setDescription('test temperature metric');
17
        $variable->setSource('internal');
18
        $variable->setParser('Simple');
19
        $variable->setValue('20');
20
21
        $variable->needHistory = true;
22
23
        $manager->persist($variable);
24
25
26
        $variable = new Variable();
27
28
        $variable->setName('humidity');
29
        $variable->setDescription('test humidity metric');
30
        $variable->setSource('internal');
31
        $variable->setParser('Argument');
32
        $variable->setValue('70');
33
34
        $variable->needHistory = true;
35
36
        $manager->persist($variable);
37
38
        $variable = new Variable();
39
40
        $variable->setName('internet.upload');
41
        $variable->setDescription('test humidity metric');
42
        $variable->setSource('internal');
43
        $variable->setParser('Argument');
44
        $variable->setValue('70');
45
46
        $manager->persist($variable);
47
48
        $variable = new Variable();
49
50
        $variable->setName('internet.download');
51
        $variable->setDescription('test humidity metric');
52
        $variable->setSource('internal');
53
        $variable->setParser('Argument');
54
        $variable->setValue('70');
55
56
        $variable->needHistory = true;
57
58
        $manager->persist($variable);
59
60
        $variable = new Variable();
61
62
        $variable->setName('internet.ping');
63
        $variable->setDescription('test humidity metric');
64
        $variable->setSource('internal');
65
        $variable->setParser('Argument');
66
        $variable->setValue('70');
67
        $variable->needHistory = true;
68
69
        $manager->persist($variable);
70
71
72
        $manager->flush();
73
    }
74
}
75