original_string: public function addClass($class, $extends = null, $implements = [])
      {
          $classId = $this->registerClass($class);
          if ($extends) {
              $parentClassId = $this->registerClass($extends);
              $this->extends[$classId] = [$parentClassId];
          }
          if (!empty($implements)) {
              $interfaceIds = [];
              foreach ($implements as $interface) {
                  $interfaceIds[] = $this->registerInterface($interface);
              }
              $this->implements[$classId] = $interfaceIds;
          }
      }
code: public function addClass($class, $extends = null, $implements = [])
      {
          $classId = $this->registerClass($class);
          if ($extends) {
              $parentClassId = $this->registerClass($extends);
              $this->extends[$classId] = [$parentClassId];
          }
          if (!empty($implements)) {
              $interfaceIds = [];
              foreach ($implements as $interface) {
                  $interfaceIds[] = $this->registerInterface($interface);
              }
              $this->implements[$classId] = $interfaceIds;
          }
      }
code_tokens: public function addClass ( $ class , $ extends = null , $ implements = [ ] ) { $ classId = $ this -> registerClass ( $ class ) ; if ( $ extends ) { $ parentClassId = $ this -> registerClass ( $ extends ) ; $ this -> extends [ $ classId ] = [ $ parentClassId ] ; } if ( ! empty ( $ implements ) ) { $ interfaceIds = [ ] ; foreach ( $ implements as $ interface ) { $ interfaceIds [ ] = $ this -> registerInterface ( $ interface ) ; } $ this -> implements [ $ classId ] = $ interfaceIds ; } }
docstring: add class to hierarchy tree
  
  @param string $class
  @param string $extends parent class
  @param array $implements interfaces that implements
  @return self
docstring_tokens: add class to hierarchy tree