SinglePermission   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A load() 0 6 1
A getPermission() 0 4 1
1
<?php
2
3
namespace JhUserTest\Fixture;
4
5
use Doctrine\Common\DataFixtures\AbstractFixture;
6
use Doctrine\Common\Persistence\ObjectManager;
7
use JhUser\Entity\Permission;
8
9
/**
10
 * Class SinglePermission
11
 * @package JhUserTest\Fixture
12
 * @author Aydin Hassan <[email protected]>
13
 */
14
class SinglePermission extends AbstractFixture
15
{
16
    /**
17
     * @var Permission
18
     */
19
    protected $permission;
20
21
    /**
22
     * {inheritDoc}
23
     */
24
    public function load(ObjectManager $manager)
25
    {
26
        $this->permission = new Permission('delete');
27
        $manager->persist($this->permission);
28
        $manager->flush();
29
    }
30
31
    /**
32
     * @return Permission
33
     */
34
    public function getPermission()
35
    {
36
        return $this->permission;
37
    }
38
}
39