Declaration Issue for Get Cache Items

robdog

Well-known member
Here is the error that I am running into:
PHP Fatal error: Declaration of Symfony\Component\Cache\CacheItem::get() must be compatible with Psr\Cache\CacheItemInterface::get(): mixed

The vendor file doesn't seem to have the response value for "mixed". I am using PHP 8.3 and on the latest version of XenForo.

Let me know if you need any other details.
 
The PSR interface we ship (src/vendor/psr/cache/src/CacheItemInterface.php) does not have the return type either, as it is not compatible with PHP 7.2. Do you have an add-on that has a dependency (or transitive dependency) on psr/cache? If so, you'll need to pin it to ^1.0|^2.0.
 
I was able to get this fixed. Here are all the items I had to pin:

"guzzlehttp/guzzle": "7.8.1",
"guzzlehttp/promises": "2.0.2",
"guzzlehttp/psr7": "2.6.2",
"psr/cache": "^1.0|^2.0",
"psr/log": "^1.1|^2",

Thanks @Jeremy P for pointing me in the right direction.
 
Back
Top Bottom