Completed
Push — master ( bd2e94...030db8 )
by Kirill
07:18
created

LoadVariableData   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 56 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 3
    public function load(ObjectManager $manager)
12
    {
13 3
        $variable = new Variable();
14
15 3
        $variable->setName('temperature');
16 3
        $variable->setDescription('test temperature metric');
17 3
        $variable->setSource('internal');
18 3
        $variable->setParser('Simple');
19 3
        $variable->setValue('20');
20
21 3
        $manager->persist($variable);
22
23
24 3
        $variable = new Variable();
25
26 3
        $variable->setName('humidity');
27 3
        $variable->setDescription('test humidity metric');
28 3
        $variable->setSource('internal');
29 3
        $variable->setParser('Argument');
30 3
        $variable->setValue('70');
31
32 3
        $manager->persist($variable);
33
34
        $variable = new Variable();
35 3
36 3
        $variable->setName('internet.upload');
37
        $variable->setDescription('test humidity metric');
38
        $variable->setSource('internal');
39
        $variable->setParser('Argument');
40
        $variable->setValue('70');
41
42
        $manager->persist($variable);
43
44
        $variable = new Variable();
45
46
        $variable->setName('internet.download');
47
        $variable->setDescription('test humidity metric');
48
        $variable->setSource('internal');
49
        $variable->setParser('Argument');
50
        $variable->setValue('70');
51
52
        $manager->persist($variable);
53
54
        $variable = new Variable();
55
56
        $variable->setName('internet.ping');
57
        $variable->setDescription('test humidity metric');
58
        $variable->setSource('internal');
59
        $variable->setParser('Argument');
60
        $variable->setValue('70');
61
62
        $manager->persist($variable);
63
64
65
        $manager->flush();
66
    }
67
}
68