From 8e636d53e9aee98bc775e44bb38f1a103624816a Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Tue, 10 Jan 2023 10:58:50 -0800 Subject: [PATCH] fix: php 8.2 dynamic property warning in MapFieldIter (#11485) addresses #11243 Defines `$key_type` in `MapFieldIter`, so as not to trigger PHP 8.2 warning. Note that this will change the visibility of `$key_type` from public in previous versions to private in this version. This is a breaking change, but anyone using `$key_type` in this way is misusing the library, so I think it's acceptable. Closes #11485 COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/11485 from bshaffer:fix-php-82-dynamic-warning-in-MapFieldIter b45c34d2be58551d44f04e938e83fbb19d9a6cf2 PiperOrigin-RevId: 501040413 --- php/src/Google/Protobuf/Internal/MapFieldIter.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/php/src/Google/Protobuf/Internal/MapFieldIter.php b/php/src/Google/Protobuf/Internal/MapFieldIter.php index 63f1875297c3..a56d27e2e315 100644 --- a/php/src/Google/Protobuf/Internal/MapFieldIter.php +++ b/php/src/Google/Protobuf/Internal/MapFieldIter.php @@ -49,6 +49,11 @@ class MapFieldIter implements \Iterator */ private $container; + /** + * @ignore + */ + private $key_type; + /** * Create iterator instance for MapField. *