allegro / php-protobuf

PHP Protobuf - Google's Protocol Buffers for PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

An error occurred to the protoc-gen-php.php

harter123 opened this issue · comments

if the proto file have a message defined :
message foo
{
repeated uint64 list = 1;
required uint64 list_count= 2;
}
,After generates the PHP file by 'protoc-gen-php.php', the file of foo.php has two methor having the same name -- "getListCount()".If running into this situation, it is better to handle it by another rule.

I would reduce a generation of repeated fields accessors to a single one returning an array (just as for the rest of the field types). This of course breaks backwards compatibility so I would make it optional in the first release (by passing an option to the compiler) adding a warning on coming deprecation of old-styled generation. In the second release I would make this default behavior keeping the old-style generation as an option available for the ones that left behind.