AlexaCRM / dynamics-webapi-toolkit

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

Fix to NullCacheItem throws error on PHP 8.2 and 8.3 as methods do not math interface implemented. #123

Closed SantiSnow closed 1 month ago

SantiSnow commented 1 month ago

Problem:

The library throws error in installation on Laravel with PHP 8.2 and 8.3. The error is thrown as methods: -get() -set() -expiresAt() -expiresAfter() Do not match with their Interface CacheItemInterface declaration. In the Interface, the methods are created with params and return types declared, which is not done in the Class. This adds the type to params and return values of the functions

The following methods were updated:

public function get(): mixed

public function set(mixed $value): static

public function expiresAt(?\DateTimeInterface $expiration): static

public function expiresAfter(int|\DateInterval|null $time): static
mrudov commented 1 month ago

The version compatible with PHP 8.2 is available in v4 branch. You can use it like so:

composer require alexacrm/dynamics-webapi-toolkit:v4.x-dev

Despite it's in development status it is stable enough to be used.