Skip to content

Handle optional fields correctly in Message_get method - #18982

Closed
s2x wants to merge 4 commits into
protocolbuffers:mainfrom
s2x:fix-property-reflection-values
Closed

s2x wants to merge 4 commits into
protocolbuffers:mainfrom
s2x:fix-property-reflection-values

Conversation

@s2x

@s2x s2x commented Oct 24, 2024

Copy link
Copy Markdown
Contributor

Refactor the Message_get method to accurately handle optional fields with presence checks by returning NULL if the field is not set. Also, add new unit tests in WellKnownTest.php to ensure correct behavior of reflection properties for optional fields with various data types.

should fix #18966

Refactor the Message_get method to accurately handle optional fields with presence checks by returning NULL if the field is not set. Also, add new unit tests in WellKnownTest.php to ensure correct behavior of reflection properties for optional fields with various data types.
@s2x
s2x requested a review from a team as a code owner October 24, 2024 09:27
@s2x
s2x requested review from bshaffer and removed request for a team October 24, 2024 09:27
Comment thread php/tests/WellKnownTest.php Resolved
s2x and others added 2 commits October 25, 2024 09:08
Replaced preg_replace_callback with implode and array_map using ucwords to simplify and improve readability of the property to function name conversion. This change ensures more consistent behavior and makes the code shorter and more maintainable.
@acozzette acozzette added php 🅰️ safe for tests Mark a commit as safe to run presubmits over and removed wait for user action 🅰️ safe for tests Mark a commit as safe to run presubmits over labels Nov 26, 2024
@github-actions github-actions Bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Nov 26, 2024
@acozzette acozzette added the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Nov 26, 2024
@github-actions github-actions Bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Nov 26, 2024
Comment thread php/tests/WellKnownTest.php Resolved
@copybara-service copybara-service Bot closed this in f1aa92a Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PHP - Different class property values ​​with and without php extension

4 participants