original_string: protected function prepareListUserRole(array &$roles)
      {
          $permissions = $this->getPermissionsUserRole();
  
          foreach ($roles as &$role) {
              if (!empty($role['permissions'])) {
                  $list = array_intersect_key($permissions, array_flip($role['permissions']));
                  $role['permissions_list'] = array_chunk($list, 20);
              }
          }
      }
code: protected function prepareListUserRole(array &$roles)
      {
          $permissions = $this->getPermissionsUserRole();
  
          foreach ($roles as &$role) {
              if (!empty($role['permissions'])) {
                  $list = array_intersect_key($permissions, array_flip($role['permissions']));
                  $role['permissions_list'] = array_chunk($list, 20);
              }
          }
      }
code_tokens: protected function prepareListUserRole ( array & $ roles ) { $ permissions = $ this -> getPermissionsUserRole ( ) ; foreach ( $ roles as & $ role ) { if ( ! empty ( $ role [ 'permissions' ] ) ) { $ list = array_intersect_key ( $ permissions , array_flip ( $ role [ 'permissions' ] ) ) ; $ role [ 'permissions_list' ] = array_chunk ( $ list , 20 ) ; } } }
docstring: Prepare an array of user roles
  @param array $roles
docstring_tokens: Prepare an array of user roles