From 9ee163a5d77c99ba0ed64a9728d3963b4a240849 Mon Sep 17 00:00:00 2001 From: Mike Lehan Date: Mon, 30 Nov 2020 19:29:13 +0000 Subject: [PATCH] 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) --- php/src/Google/Protobuf/Internal/MapField.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/src/Google/Protobuf/Internal/MapField.php b/php/src/Google/Protobuf/Internal/MapField.php index 2c66aa0c19..719fb350bd 100644 --- a/php/src/Google/Protobuf/Internal/MapField.php +++ b/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.