chobie / php-protocolbuffers

PECL ProtocolBuffers
pecl.php.net/package/protocolbuffers
Other
128 stars 38 forks source link

[protoc-gen-php] Enum default values: case mismatch #23

Closed MonkeyMaster closed 10 years ago

MonkeyMaster commented 10 years ago

Enum items are converted to upper case in constant definitions while remain in camel case in default values.

enum DocumentType {
    UnknownDocumentType = -1;
...
<?php
 * @enum Diadoc.Api.Proto.Documents.DocumentType
 */
class Diadoc_Api_Proto_Documents_DocumentType
{
  const UNKNOWNDOCUMENTTYPE = -1;

...

      $desc->addField(6, new ProtocolBuffersFieldDescriptor(array(
        "type"     => ProtocolBuffers::TYPE_ENUM,
        "name"     => "DocumentType",
        "required" => false,
        "optional" => true,
        "repeated" => false,
        "packable" => false,
        "default"  => Diadoc_Api_Proto_Documents_DocumentType::UnknownDocumentType,
      )));