cache: 1.12.1 and PHP7 breaking compatibility

Hi,

I just noticed something strange. Based on https://github.com/doctrine/cache/blob/1.12.1/composer.json, it seems that 1.12.1 should be ~7.1 and 8.0 compatible. But in this version, we can also see this: https://github.com/doctrine/cache/blob/1.12.1/lib/Doctrine/Common/Cache/Psr6/TypedCacheItem.php#L24

    public function __construct(
        private string $key,
        private mixed $value,
        private bool $isHit,
    ) {
    }

But if I’m right, and based on PHP website, this is a PHP8 feature.

Can you please confirm that 1.12.* is not PHP7 compatible please?

Thank you.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (9 by maintainers)

Most upvoted comments

Oh, then that’s the reason why. Resource discovery should not be used on directories you don’t own! This should be replaced by explicit service registration.

OK, thanks for the notice. Then we’ll discuss it internally and see how to fix it.

Thank you!

Please provide a small reproducing app if you want any of us to have a look. On my side, I see no issue with this very repo, but it’d might still be good to understand where this comes from.

the TypedCachedItem class is only used on PHP 8+. See https://github.com/doctrine/cache/blob/331b4d5dbaeab3827976273e9356b3b453c300ce/lib/Doctrine/Common/Cache/Psr6/CacheAdapter.php#L80-L92

So there is no issue (and the CI confirms it)