SingleUser   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A load() 0 11 1
A getUser() 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 JhUser\Entity\User;
8
9
/**
10
 * Class SingleUser
11
 * @package JhUserTest\Fixture
12
 * @author Aydin Hassan <[email protected]>
13
 */
14
class SingleUser extends AbstractFixture
15
{
16
    /**
17
     * @var User
18
     */
19
    protected $user;
20
21
    /**
22
     * {inheritDoc}
23
     */
24
    public function load(ObjectManager $manager)
25
    {
26
        $this->user = new User();
27
28
        $this->user
29
            ->setEmail('[email protected]')
30
            ->setPassword('password');
31
32
        $manager->persist($this->user);
33
        $manager->flush();
34
    }
35
36
    /**
37
     * @return User
38
     */
39
    public function getUser()
40
    {
41
        return $this->user;
42
    }
43
}
44