code: public function addTypeFactory(IAttributeTypeFactory $typeFactory)
      {
          $typeName = $typeFactory->getTypeName();
          if (isset($this->typeFactories[$typeName])) {
              throw new \RuntimeException('Attribute type ' . $typeName . ' is already registered.');
          }
  
          $this->typeFactories[$typeName] = $typeFactory;
  
          return $this;
      }
docs: {@inheritdoc}
  
  @throws \RuntimeException When the type is already registered.