original_string: public static function groupByType(array $objects)
      {
          $perType = [];
          foreach ($objects as $object) {
              $type = $object->getType();
              if (!isset($perType[$type])) {
                  $perType[$type] = [];
              }
              $perType[$type][] = $object;
          }
          return $perType;
      }
code: public static function groupByType(array $objects)
      {
          $perType = [];
          foreach ($objects as $object) {
              $type = $object->getType();
              if (!isset($perType[$type])) {
                  $perType[$type] = [];
              }
              $perType[$type][] = $object;
          }
          return $perType;
      }
code_tokens: public static function groupByType ( array $ objects ) { $ perType = [ ] ; foreach ( $ objects as $ object ) { $ type = $ object -> getType ( ) ; if ( ! isset ( $ perType [ $ type ] ) ) { $ perType [ $ type ] = [ ] ; } $ perType [ $ type ] [ ] = $ object ; } return $ perType ; }
docstring: Group typed objects by their type
  
  @param Typed[] $objects
  @return Typed[][] map indexed by types and lists of objects as values
docstring_tokens: Group typed objects by their type