SingleRunningBalance   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 1
cbo 4
dl 0
loc 34
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A load() 0 15 1
A getBalance() 0 4 1
1
<?php
2
3
namespace JhFlexiTimeTest\Fixture;
4
5
use Doctrine\Common\DataFixtures\AbstractFixture;
6
use Doctrine\Common\Persistence\ObjectManager;
7
use JhFlexiTime\Entity\RunningBalance;
8
use JhUser\Entity\User;
9
10
/**
11
 * Class SingleRunningBalance
12
 * @package JhUserTest\Fixture
13
 * @author Aydin Hassan <[email protected]>
14
 */
15
class SingleRunningBalance extends AbstractFixture
16
{
17
    /**
18
     * @var RunningBalance
19
     */
20
    protected $runningBalance;
21
22
    /**
23
     * {inheritDoc}
24
     */
25
    public function load(ObjectManager $manager)
26
    {
27
        $this->runningBalance = new RunningBalance();
28
29
        $user = new User();
30
        $user->setEmail("[email protected]")
31
             ->setPassword('password');
32
        $this->runningBalance
33
            ->setUser($user)
34
            ->setBalance('10');
35
36
        $manager->persist($user);
37
        $manager->persist($this->runningBalance);
38
        $manager->flush();
39
    }
40
41
    /**
42
     * @return RunningBalance
43
     */
44
    public function getBalance()
45
    {
46
        return $this->runningBalance;
47
    }
48
}
49