| Conditions | 1 |
| Paths | 1 |
| Total Lines | 28 |
| Code Lines | 24 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 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); |
||
|
|
|||
| 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 | } |
||
| 44 |
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.