original_string: public function get_groups_info() {
  
          if ($this->cachegroups !== null) {
              return $this->cachegroups;
          }
  
          $groups = [];
  
          foreach (core_filetypes::get_types() as $ext => $info) {
              if (isset($info['groups']) && is_array($info['groups'])) {
                  foreach ($info['groups'] as $group) {
                      if (!isset($groups[$group])) {
                          $groups[$group] = (object) [
                              'extensions' => [],
                              'mimetypes' => [],
                          ];
                      }
                      $groups[$group]->extensions['.'.$ext] = true;
                      if (isset($info['type'])) {
                          $groups[$group]->mimetypes[$info['type']] = true;
                      }
                  }
              }
          }
  
          foreach ($groups as $group => $info) {
              $info->extensions = array_keys($info->extensions);
              $info->mimetypes = array_keys($info->mimetypes);
          }
  
          $this->cachegroups = $groups;
          return $this->cachegroups;
      }
code: public function get_groups_info() {
  
          if ($this->cachegroups !== null) {
              return $this->cachegroups;
          }
  
          $groups = [];
  
          foreach (core_filetypes::get_types() as $ext => $info) {
              if (isset($info['groups']) && is_array($info['groups'])) {
                  foreach ($info['groups'] as $group) {
                      if (!isset($groups[$group])) {
                          $groups[$group] = (object) [
                              'extensions' => [],
                              'mimetypes' => [],
                          ];
                      }
                      $groups[$group]->extensions['.'.$ext] = true;
                      if (isset($info['type'])) {
                          $groups[$group]->mimetypes[$info['type']] = true;
                      }
                  }
              }
          }
  
          foreach ($groups as $group => $info) {
              $info->extensions = array_keys($info->extensions);
              $info->mimetypes = array_keys($info->mimetypes);
          }
  
          $this->cachegroups = $groups;
          return $this->cachegroups;
      }
code_tokens: public function get_groups_info ( ) { if ( $ this -> cachegroups !== null ) { return $ this -> cachegroups ; } $ groups = [ ] ; foreach ( core_filetypes :: get_types ( ) as $ ext => $ info ) { if ( isset ( $ info [ 'groups' ] ) && is_array ( $ info [ 'groups' ] ) ) { foreach ( $ info [ 'groups' ] as $ group ) { if ( ! isset ( $ groups [ $ group ] ) ) { $ groups [ $ group ] = ( object ) [ 'extensions' => [ ] , 'mimetypes' => [ ] , ] ; } $ groups [ $ group ] -> extensions [ '.' . $ ext ] = true ; if ( isset ( $ info [ 'type' ] ) ) { $ groups [ $ group ] -> mimetypes [ $ info [ 'type' ] ] = true ; } } } } foreach ( $ groups as $ group => $ info ) { $ info -> extensions = array_keys ( $ info -> extensions ) ; $ info -> mimetypes = array_keys ( $ info -> mimetypes ) ; } $ this -> cachegroups = $ groups ; return $ this -> cachegroups ; }
docstring: Provides a list of all known file type groups and their properties.
  
  @return array
docstring_tokens: Provides a list of all known file type groups and their properties .