| Conditions | 5 |
| Paths | 5 |
| Total Lines | 27 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | protected function createPrivilegesForUser(Domain $domain, User $user, array $roleIds) |
||
| 21 | { |
||
| 22 | $privileges = [ ]; |
||
| 23 | |||
| 24 | foreach ($roleIds as $roleId) { |
||
| 25 | $role = Role::find($roleId); |
||
| 26 | |||
| 27 | // Get ancestors domains only if it is allowed |
||
| 28 | if (config('uccello.roles.display_ancestors_roles')) { |
||
| 29 | $treeDomainsIds = $domain->findAncestors()->pluck('id'); |
||
| 30 | } else { |
||
| 31 | $treeDomainsIds = collect([ $domain->id ]); |
||
| 32 | } |
||
| 33 | |||
| 34 | if (is_null($role) || !$treeDomainsIds->contains($role->domain->id)) { |
||
| 35 | continue; |
||
| 36 | } |
||
| 37 | |||
| 38 | // Create a new privilege and ignore duplicates |
||
| 39 | $privileges[ ] = Privilege::firstOrCreate([ |
||
| 40 | 'domain_id' => $domain->id, |
||
| 41 | 'role_id' => $role->id, |
||
| 42 | 'user_id' => $user->id |
||
| 43 | ]); |
||
| 44 | } |
||
| 45 | |||
| 46 | return $privileges; |
||
| 47 | } |
||
| 48 | } |
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