doctrine / cache

Doctrine Cache component

Home Page:https://www.doctrine-project.org/projects/cache.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Required PHP Version is Incorrect

Bellardia opened this issue · comments

This project now relies on PHP 7.4+ at least, but composer.json still indicates support for 7.1+:

"require": {
    "php": "~7.1 || ^8.0"
},

It is correct.

commented

Are you sure this is correct? I get a php linter error with php 7.3 on TypedCacheItem.php line 18, on https://github.com/doctrine/cache/blob/2.1.x/lib/Doctrine/Common/Cache/Psr6/TypedCacheItem.php#L18

% php73 -l ./vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/TypedCacheItem.php
PHP Parse error:  syntax error, unexpected '?', expecting function (T_FUNCTION) or const (T_CONST) in ./vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/TypedCacheItem.php on line 18

It looks like type hinting for properties of a class/object was added in php 7.4. https://www.php.net/manual/en/migration74.new-features.php

Yes, we are. That piece of code is not executed on PHP 7.3.

commented

Ah, I see. Thanks for clarifying, and sorry for the noise.