-
Notifications
You must be signed in to change notification settings - Fork 15.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exposed more functions in FieldDescriptor and OneofDescriptor. #10102
Exposed more functions in FieldDescriptor and OneofDescriptor. #10102
Conversation
/** | ||
* @return boolean | ||
*/ | ||
public function hasOptionalKeyword() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should keep this function; it is useful.
You can implement it to match the C++ definition: http://google3/third_party/protobuf/descriptor.h;l=2387-2391;rcl=452188950
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the C++ implementation needs to rely on many fields and functions that don't exist here yet. I'll leave this function to you. I may get back here once I implement other functions that I need for my feature.
Having said that, IMHO, it's a broken function (for a while). Leaving it like this doesn't provide any good unless we provide the correct implementation soon.
$json_name = $proto->hasJsonName() ? $proto->getJsonName() : | ||
lcfirst(implode('', array_map('ucwords', explode('_', $proto->getName())))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is redundant with the if clause below.
af2b22e
to
88d57d4
Compare
88d57d4
to
0f1574a
Compare
FieldDescriptor
getContainingOneof
andgetRealContainingOneof
.OneofDescriptor
isSynthetic
work.