protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

PHP immutable messages

Open mssimi opened this issue 5 years ago • 1 comments

PHP messages are generated mutable, that is actually not good idea, do we really want to let programmer to modify message data once received from by client from server for example? I think not, I should not be possible to modify message once instantiated.

I do propose that generated PHP message should not contain setters, everything should be set via constructor to ensure message immutability. This will force programmer to not mess with message data when he should not.

mssimi avatar Jul 21 '20 11:07 mssimi

Not a good idea. It's currently impossible to mock a Message object in unit test (segfault)

vfalduto avatar Mar 30 '21 07:03 vfalduto

This would be a major project which we lack staffing. Closing for now, please re-open to help raise priority

esorot avatar Sep 01 '22 18:09 esorot