/**
  * @param \google\protobuf\FileDescriptorProto $fileDescriptor
  * @param \google\protobuf\DescriptorProto     $messageDescriptor
  * @param string                               $parent
  *
  * @return \Protobuf\Compiler\Entity
  */
 protected function generateMessage(FileDescriptorProto $fileDescriptor, DescriptorProto $messageDescriptor, $parent = null)
 {
     $type = Entity::TYPE_MESSAGE;
     $name = $messageDescriptor->getName();
     $entity = new Entity($type, $name, $messageDescriptor, $fileDescriptor, $parent);
     if ($messageDescriptor->hasExtensionList() && $this->containsProtobufExtension($messageDescriptor->getExtensionList())) {
         $entity->setProtobufExtension(true);
     }
     return $entity;
 }