| Conditions | 8 |
| Paths | 10 |
| Total Lines | 30 |
| Code Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | public function load(Tenant $tenant) |
||
| 28 | { |
||
| 29 | $eventManager = $this->roleService->getManager()->getEventManager(); |
||
| 30 | |||
| 31 | foreach ($eventManager->getListeners() as $event => $listeners) { |
||
| 32 | foreach ($listeners as $key => $listener) { |
||
| 33 | if (is_object($listener) && $listener instanceof PropagationListener) { |
||
| 34 | $listener->setEnabled(false); |
||
| 35 | } else if (is_string($listener) && $listener === PropagationListener::class) { |
||
| 36 | $eventManager->removeEventListener(['postPersist'], $listener); |
||
| 37 | } |
||
| 38 | } |
||
| 39 | } |
||
| 40 | |||
| 41 | $data = (array) json_decode(json_encode($tenant->getData())); |
||
| 42 | $objects = Objects::parseFile($this->path, $data); |
||
| 43 | $manager = $this->roleService->getManager(); |
||
| 44 | |||
| 45 | foreach ($objects as $object) { |
||
| 46 | $role = $this->roleService->createInstance(); |
||
| 47 | $role |
||
| 48 | ->setUuid($object->uuid) |
||
| 49 | ->setOwner($object->owner) |
||
| 50 | ->setOwnerUuid($object->owner_uuid) |
||
| 51 | ->setSlug($object->slug) |
||
| 52 | ->setTitle((array) $object->title) |
||
| 53 | ->setPermissions((array) $object->permissions) |
||
| 54 | ->setTenant($object->tenant); |
||
| 55 | $manager->persist($role); |
||
| 56 | $manager->flush(); |
||
| 57 | } |
||
| 60 |
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