SingleRole::getRole()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace JhUserTest\Fixture;
4
5
use Doctrine\Common\DataFixtures\AbstractFixture;
6
use Doctrine\Common\Persistence\ObjectManager;
7
use JhUser\Entity\HierarchicalRole;
8
9
/**
10
 * Class SingleRole
11
 * @package JhUserTest\Fixture
12
 * @author Aydin Hassan <[email protected]>
13
 */
14
class SingleRole extends AbstractFixture
15
{
16
    /**
17
     * @var Role
18
     */
19
    protected $role;
20
21
    /**
22
     * {inheritDoc}
23
     */
24
    public function load(ObjectManager $manager)
25
    {
26
        $this->role = new HierarchicalRole();
0 ignored issues
show
Documentation Bug introduced by
It seems like new \JhUser\Entity\HierarchicalRole() of type object<JhUser\Entity\HierarchicalRole> is incompatible with the declared type object<JhUserTest\Fixture\Role> of property $role.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
27
28
        $this->role
29
            ->setName('admin');
30
31
        $manager->persist($this->role);
32
        $manager->flush();
33
    }
34
35
    /**
36
     * @return Role
37
     */
38
    public function getRole()
39
    {
40
        return $this->role;
41
    }
42
}
43