Filter User item names adding default items #984
Annotations
1 error and 2 warnings
mutation / PHP 8.3-ubuntu-latest
Process completed with exit code 1.
|
mutation / PHP 8.3-ubuntu-latest:
src/Manager.php#L118
Escaped Mutant for Mutator "IfNegation":
--- Original
+++ New
@@ @@
{
$userItemNames = $this->assignmentsStorage->filterUserItemNames($userId, $itemNames);
foreach ($this->defaultRoleNames as $roleName) {
- if (in_array($roleName, $itemNames)) {
+ if (!in_array($roleName, $itemNames)) {
$userItemNames[] = $roleName;
}
}
|
mutation / PHP 8.3-ubuntu-latest:
src/Manager.php#L122
Escaped Mutant for Mutator "ArrayOneItem":
--- Original
+++ New
@@ @@
$userItemNames[] = $roleName;
}
}
- return $userItemNames;
+ return count($userItemNames) > 1 ? array_slice($userItemNames, 0, 1, true) : $userItemNames;
}
public function canAddChild(string $parentName, string $childName) : bool
{
|