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