original_string: public function setDocumentTypesConfig(array $documentTypes)
      {
          foreach ($documentTypes as $name => $class) {
              $documentType = new $class;
              if (!$documentType instanceof AbstractDocumentType) {
                  throw new GeneratorServiceException(
                      'Configured class of document type must be descendant of'
                          . ' Infotech\DocumentGenerator\DocumentType\AbstractDocumentType class'
                  );
              }
              $this->registerDocumentType($name, $documentType);
          }
      }
code: public function setDocumentTypesConfig(array $documentTypes)
      {
          foreach ($documentTypes as $name => $class) {
              $documentType = new $class;
              if (!$documentType instanceof AbstractDocumentType) {
                  throw new GeneratorServiceException(
                      'Configured class of document type must be descendant of'
                          . ' Infotech\DocumentGenerator\DocumentType\AbstractDocumentType class'
                  );
              }
              $this->registerDocumentType($name, $documentType);
          }
      }
code_tokens: public function setDocumentTypesConfig ( array $ documentTypes ) { foreach ( $ documentTypes as $ name => $ class ) { $ documentType = new $ class ; if ( ! $ documentType instanceof AbstractDocumentType ) { throw new GeneratorServiceException ( 'Configured class of document type must be descendant of' . ' Infotech\DocumentGenerator\DocumentType\AbstractDocumentType class' ) ; } $ this -> registerDocumentType ( $ name , $ documentType ) ; } }
docstring: Instantiate and registering document types
  
  @param array $documentTypes Document types configuration map [name => fully qualified class name]
  @throws GeneratorServiceException if map contains name of class that is not descendant of AbstractDocumentType
  @throws GeneratorServiceException if map contains type name that already has been registered
docstring_tokens: Instantiate and registering document types