aldas / modbus-tcp-client

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

Fix ResultContainer::offsetGet() return type #119

Closed Phenix789 closed 1 year ago

Phenix789 commented 1 year 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 1 year ago

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