Total Complexity | 7 |
Total Lines | 54 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | class MultipleRoles implements RoleInterface, Stringable |
||
15 | { |
||
16 | /** |
||
17 | * @var string[] |
||
18 | */ |
||
19 | private array $roles = []; |
||
20 | |||
21 | /** |
||
22 | * @param string[] $roles |
||
23 | */ |
||
24 | 5 | public function __construct(array $roles = []) |
|
28 | } |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Add a role to the list. |
||
33 | */ |
||
34 | 4 | public function addRole(string $role): void |
|
35 | { |
||
36 | 4 | $this->roles[] = $role; |
|
37 | |||
38 | 4 | $this->roles = array_unique($this->roles); |
|
39 | 4 | sort($this->roles); |
|
40 | } |
||
41 | |||
42 | 1 | public function getRoleId(): never |
|
1 ignored issue
–
show
|
|||
43 | { |
||
44 | 1 | throw new Exception('This should never be called. If it is, then it means this class is not used correctly'); |
|
45 | } |
||
46 | |||
47 | /** |
||
48 | * Return the role list. |
||
49 | * |
||
50 | * @return string[] |
||
51 | */ |
||
52 | 4 | public function getRoles(): array |
|
55 | } |
||
56 | |||
57 | /** |
||
58 | * Return whether the given role is included in the list. |
||
59 | */ |
||
60 | 1 | public function has(string $role): bool |
|
61 | { |
||
62 | 1 | return in_array($role, $this->roles, true); |
|
63 | } |
||
64 | |||
65 | 2 | public function __toString(): string |
|
68 | } |
||
69 | } |
||
70 |
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