Passed
Push — master ( aa34fb...e6b990 )
by Derek Stephen
02:45
created

LoadUsers::load()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 28
Code Lines 24

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 24
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 28
rs 9.536
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Bone\User\Fixtures;
6
7
use Del\Entity\User;
8
use Del\Person\Entity\Person;
9
use Doctrine\Common\DataFixtures\FixtureInterface;
10
use Doctrine\Persistence\ObjectManager;
11
12
class LoadUsers implements FixtureInterface
13
{
14
    public function load(ObjectManager $manager)
15
    {
16
        $person = new Person();
17
        $person->setFirstName('Super');
18
        $person->setLastName('McUser');
19
        $user = new  User();
20
        $user->getPerson($person);
0 ignored issues
show
Unused Code introduced by
The call to Del\Entity\BaseUser::getPerson() has too many arguments starting with $person. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

20
        $user->/** @scrutinizer ignore-call */ 
21
               getPerson($person);

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
21
        $user->setEmail('[email protected]');
22
        $manager->persist($user);
23
        $manager->flush();
24
25
        $person = new Person();
26
        $person->setFirstName('Super');
27
        $person->setLastName('McAdmin');
28
        $user = new  User();
29
        $user->getPerson($person);
30
        $user->setEmail('[email protected]');
31
        $manager->persist($user);
32
        $manager->flush();
33
34
        $person = new Person();
35
        $person->setFirstName('Norma');
36
        $person->setLastName('McUser');
37
        $user = new  User();
38
        $user->getPerson($person);
39
        $user->setEmail('[email protected]');
40
        $manager->persist($user);
41
        $manager->flush();
42
    }
43
}
44