Update param type on offsetGet (#8033)

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)
pull/8106/head
Mike Lehan 4 years ago committed by GitHub
parent 9432c99f37
commit 9ee163a5d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      php/src/Google/Protobuf/Internal/MapField.php

@ -129,7 +129,7 @@ class MapField implements \ArrayAccess, \IteratorAggregate, \Countable
*
* This will also be called for: $ele = $arr[$key]
*
* @param object $key The key of the element to be fetched.
* @param int|bool|string $key The key of the element to be fetched.
* @return object The stored element at given key.
* @throws \ErrorException Invalid type for index.
* @throws \ErrorException Non-existing index.

Loading…
Cancel
Save