AlexaCRM / dynamics-webapi-toolkit

Dynamics 365 Web API Toolkit for PHP
MIT License
75 stars 58 forks source link

Deprecated return type for function offsetGet #107

Closed sebasparola closed 1 month ago

sebasparola commented 5 months ago

Describe the bug For newer versions of PHP (>=8.1) the offsetGet functionality is giving deprecation warnings

To Reproduce Create a new Entity 555

Expected behavior No warning or Error

Additional context Screenshot from 2024-04-03 11-11-05 Screenshot from 2024-04-03 11-15-39

sebasparola commented 5 months ago

Two possible solutions that I have tested and worked fine for this were:

  1. add the return type mixed for the function in the Entity class: public function offsetGet( $offset ) : mixed {

or

  1. add the overrride #[\ReturnTypeWillChange] annotation to the offsetGet function
mrudov commented 1 month ago

Fixed in v4 branch. Please refer README.md for details.