aldas / modbus-tcp-client

PHP client for Modbus TCP and Modbus RTU over TCP (can be used for serial)
Apache License 2.0
196 stars 56 forks source link

Fix ResultContainer::offsetGet() return type #119

Closed Phenix789 closed 2 years ago

Phenix789 commented 2 years ago

Fix PHP 8.1 deprecated warning


First, thank a lot for you work on this library, it's help me a lot.
But, recently I moved to PHP 8.1 with 2.4 version.
I had several deprecation, and I saw you release a 3.0 version with several fixes for PHP 8.1 type system.
But, it's look like you miss one.
This PR is to fix this.

I don't know if it was intentionally for some backup compatibilty.
So, maybe I can suggest to add #[ReturnTypeWillChange]

aldas commented 2 years ago

Thanks. I think I missed that one somehow. I used phpstan warnings - probably it did not catch that one.