Skip to content
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

Update param type for PHP Internal Mapfield::offsetGet #8033

Merged
merged 1 commit into from Nov 30, 2020

Conversation

M1ke
Copy link
Contributor

@M1ke M1ke commented Nov 12, 2020

This is a minor doctype change for the PHP codebase, Internal\Mapfield::offsetGet method

The param was typed as object which is invalid as when items are set in the container the key passes through checkKey where it enforces the key must be various classes of integer, bool or string. Thus I have replaced it with a union type (in future this can be a proper PHP level typehint, but for now only doctype)

I encountered this whilst using a client that consumes protocol buffers, and found that my IDE was telling me that $item->offsetGet('key') was invalid, yet on running the code I got the expected output from the Map container.

The param was typed as `object` which is invalid as when items are set in the container the key passes through `checkKey` where it enforces the key must be various classes of integer, bool or string. Thus I have replaced it with a union type (in future this can be a proper PHP level typehint, but for now only doctype)
@google-cla
Copy link

google-cla bot commented Nov 12, 2020

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no label Nov 12, 2020
@M1ke M1ke changed the title Update param type on offsetGet Update param type for PHP Internal Mapfield::offsetGet Nov 12, 2020
@M1ke
Copy link
Contributor Author

M1ke commented Nov 12, 2020

@googlebot I signed it!

@google-cla google-cla bot added cla: yes and removed cla: no labels Nov 12, 2020
@M1ke
Copy link
Contributor Author

M1ke commented Nov 27, 2020

Thanks for the approval, the failing merge check doesn't look like something related to this work but not sure how to resolve that?

@TeBoring TeBoring merged commit 9ee163a into protocolbuffers:master Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants