Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible types between PragmaRX\Countries\Package\Services\Cache\Service and Psr\SimpleCache\CacheInterface #207

Open
ghunti opened this issue Oct 10, 2024 · 7 comments

Comments

@ghunti
Copy link

ghunti commented Oct 10, 2024

Hi @antonioribeiro

The latest version of thhis package, changed the compatiblity of the psr/simple-cache to ^3.0.
The problem is that now there's an incompatibility between PragmaRX\Countries\Package\Services\Cache\Service and Psr\SimpleCache\CacheInterface:

Declaration of PragmaRX\Countries\Package\Services\Cache\Service::get($key,  $default = null) 
must be compatible with Psr\SimpleCache\CacheInterface::get(string $key, mixed $default = null): mixed 
@antonioribeiro
Copy link
Owner

Yes, sorry about that, I believe I'll have to tag a major version on this one as it's a breaking change. Are you able to use a fixed version (previous one) for now?

@ghunti
Copy link
Author

ghunti commented Oct 10, 2024

Hi @antonioribeiro
No problem on my side :-)
Would adding a return type of :mixed be considered a BC? Because I think it's the only thing missing

@ghunti
Copy link
Author

ghunti commented Oct 25, 2024

Hello @antonioribeiro ? :-)

@ghunti
Copy link
Author

ghunti commented Oct 28, 2024

Hey @antonioribeiro I think #203 fixes the issue

@antonioribeiro
Copy link
Owner

Hello @ghunti , unfortunately is never that simple. I just took some time to merge that PR and also move back to use Illuminate/Collections. Tests are mostly passing on both packages (Countries and Coollection), but we need help to fix the missing ones.

@ghunti
Copy link
Author

ghunti commented Oct 30, 2024

Hey @antonioribeiro totally understand X-) Can you point me to the PR/branch where you are working? I might be able to help :-)

@VictorMGomes
Copy link

Hello i'm facing the same problem:

[2024-12-21 22:52:26] local.ERROR: Declaration of PragmaRX\Countries\Package\Services\Cache\Service::get($key, $default = null) must be compatible with Psr\SimpleCache\CacheInterface::get(string $key, mixed $default = null): mixed {"exception":"[object] (Symfony\Component\ErrorHandler\Error\FatalError(code: 0): Declaration of PragmaRX\Countries\Package\Services\Cache\Service::get($key, $default = null) must be compatible with Psr\SimpleCache\CacheInterface::get(string $key, mixed $default = null): mixed at /var/www/html/vendor/pragmarx/countries/src/package/Services/Cache/Service.php:90)
[stacktrace]

For now i back this package to 0.8.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants