original_string: protected function addAuthzGroupsToPrivileges(array $privileges, $authzGroupsPrivileges, array $authzGroups)
      {
          $authzGroupsPrivileges = !is_string($authzGroupsPrivileges) ? $authzGroupsPrivileges : [$authzGroupsPrivileges];
          
          foreach($authzGroupsPrivileges as $privilege) {
              $current = !empty($privileges[$privilege]) ? $privileges[$privilege] : [];
              $privileges[$privilege] = array_unique(array_merge($current, $authzGroups));
          }
          
          return $privileges;
      }
code: protected function addAuthzGroupsToPrivileges(array $privileges, $authzGroupsPrivileges, array $authzGroups)
      {
          $authzGroupsPrivileges = !is_string($authzGroupsPrivileges) ? $authzGroupsPrivileges : [$authzGroupsPrivileges];
          
          foreach($authzGroupsPrivileges as $privilege) {
              $current = !empty($privileges[$privilege]) ? $privileges[$privilege] : [];
              $privileges[$privilege] = array_unique(array_merge($current, $authzGroups));
          }
          
          return $privileges;
      }
code_tokens: protected function addAuthzGroupsToPrivileges ( array $ privileges , $ authzGroupsPrivileges , array $ authzGroups ) { $ authzGroupsPrivileges = ! is_string ( $ authzGroupsPrivileges ) ? $ authzGroupsPrivileges : [ $ authzGroupsPrivileges ] ; foreach ( $ authzGroupsPrivileges as $ privilege ) { $ current = ! empty ( $ privileges [ $ privilege ] ) ? $ privileges [ $ privilege ] : [ ] ; $ privileges [ $ privilege ] = array_unique ( array_merge ( $ current , $ authzGroups ) ) ; } return $ privileges ; }
docstring: Populate an array of privileges with their corresponding authz groups
  
  @param  array          $privileges            The resulting array
  @param  string|array   $authzGroupsPrivileges The privileges that the authzgroup has
  @param  array          $authzGroups
  @return array          $privileges
docstring_tokens: Populate an array of privileges with their corresponding authz groups