diff --git a/src/BenGorUser/User/Domain/Model/User.php b/src/BenGorUser/User/Domain/Model/User.php index dc7d883d..b4f905f9 100644 --- a/src/BenGorUser/User/Domain/Model/User.php +++ b/src/BenGorUser/User/Domain/Model/User.php @@ -457,6 +457,7 @@ public function revoke(UserRole $aRole) foreach ($this->roles as $key => $role) { if ($role->equals($aRole)) { unset($this->roles[$key]); + $this->roles = array_values($this->roles); break; } throw new UserRoleAlreadyRevokedException();