-
-
Notifications
You must be signed in to change notification settings - Fork 406
Is the php-psr extension installed by default (or by mistake) #799
Description
Describe the bug
Recently we have bumped requirements for a project and it has started to use Symfony 7.x, more exactly the Cache component. And, while phplint is passing perfectly with PHP 7.x, for any run with PHP >= 8.0, we get the following error:
PHP Fatal error: Declaration of Symfony\Component\Cache\CacheItem::expiresAt(?DateTimeInterface $expiration): static must be compatible with PsrExt\Cache\CacheItemInterface::expiresAt($expiration) in /home/runner/work/moodle-cs/moodle-cs/vendor/symfony/cache/CacheItem.php on line 77
Then, looking to the list of installed extensions (wiki), I cannot see the php-psr extension there.
But, if I disable it in the workflow (workaround) using extensions: :php-psr, then the tests pass ok.
So, apart from the apparent incompatibility between Symfony Cache 7.x and the PSR extension... and why we are (or not) linting the vendor directory... this issue is more about to clarify if the extension is correctly installed (and should be listed in the docs). Or if it's installed "by mistake", and it shouldn't.
Version
- I have checked releases, and the bug exists in the latest patch version of
v1orv2. -
v2 -
v1
Runners
- GitHub Hosted
- Self Hosted
Operating systems
ubuntu-latest (22.04)
PHP versions
8.0 to 8.2 (probably also 8.3)
To Reproduce
Install Symfony Cache 7.x and try PHP-linting.
Get the linting problem detailed in the description.
Expected behavior
Linting should end ok
Screenshots/Logs
- failing run (because php-psr is installed by default): https://github.com/stronk7/moodle-cs/actions/runs/7118709260
Additional context
Are you willing to submit a PR?
I'm afraid, I don't know enough :-)