Conditions | 8 |
Paths | 10 |
Total Lines | 32 |
Code Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
24 | public function load(ObjectManager $manager) |
||
25 | { |
||
26 | $eventManager = $manager->getEventManager(); |
||
27 | |||
28 | foreach ($eventManager->getListeners() as $event => $listeners) { |
||
29 | foreach ($listeners as $key => $listener) { |
||
30 | if (is_object($listener) && $listener instanceof IdentityListener) { |
||
31 | $listener->setEnabled(false); |
||
32 | } else if (is_string($listener) && $listener === IdentityListener::class) { |
||
33 | $eventManager->removeEventListener(['postPersist'], $listener); |
||
34 | } |
||
35 | } |
||
36 | } |
||
37 | |||
38 | $userManager = $this->container->get('fos_user.user_manager'); |
||
39 | $objects = $this->parse($this->path); |
||
40 | |||
41 | foreach ($objects as $object) { |
||
42 | $user = $userManager->createUser(); |
||
43 | $user |
||
44 | ->setUuid($object->uuid) |
||
45 | ->setUsername($object->username) |
||
46 | ->setEmail($object->email) |
||
47 | ->setPlainPassword($object->password) |
||
48 | ->setRoles($object->roles) |
||
49 | ->setOwner($object->owner) |
||
50 | ->setOwnerUuid($object->owner_uuid) |
||
51 | ->setIdentity($object->identity) |
||
52 | ->setIdentityUuid($object->identity_uuid) |
||
53 | ->setEnabled($object->enabled) |
||
54 | ->setTenant($object->tenant); |
||
55 | $userManager->updateUser($user); |
||
56 | } |
||
59 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths