| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | public function load(ObjectManager $manager) |
||
| 19 | { |
||
| 20 | $i = 1; |
||
| 21 | $user = [ |
||
| 22 | 'name' => 'User ' . $i, |
||
| 23 | 'email' => 'user' . $i . '@users.net', |
||
| 24 | ]; |
||
| 25 | |||
| 26 | $obj = new UserModel(); |
||
| 27 | $obj->setName($user['name']); |
||
| 28 | $obj->setEmail($user['email']); |
||
| 29 | |||
| 30 | $manager->persist($obj); |
||
| 31 | $manager->flush(); |
||
| 32 | |||
| 33 | $this->addReference('user_' . $i, $obj); |
||
| 34 | } |
||
| 35 | |||
| 46 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.