Closed jeslopcru closed 6 months ago
You shouldn't run PHP-CS-Fixer on your vendor folder. As for PHPStan, you can ignore that file with this snippet in your config:
parameters:
excludePaths:
analyseAndScan:
- vendor/sentry/sentry-symfony/src/Tracing/HttpClient/TraceableResponseForV4.php
We could try to make that class conditionally declared to fix this, but I think PHPStan would have errors anyway.
Awesome! Thank you so much for the clarification. I will do this change on my PHPStan config
Only to give more information about it: The project where I'm using sentry is in PHP 8.2.5 and Symfony 6.4 When I executed the test the problem it was the same:
PHP Fatal error: Declaration of Sentry\SentryBundle\Tracing\HttpClient\TraceableResponseForV4::getInfo(?string $type = null) must be compatible with Symfony\Contracts\HttpClient\ResponseInterface::getInfo(?string $type = null): mixed in /home/runner/work/phone-app/phone-app/vendor/sentry/sentry-symfony/src/Tracing/HttpClient/TraceableResponseForV4.php on line 15
Fatal error: Declaration of Sentry\SentryBundle\Tracing\HttpClient\TraceableResponseForV4::getInfo(?string $type = null) must be compatible with Symfony\Contracts\HttpClient\ResponseInterface::getInfo(?string $type = null): mixed in /home/runner/work/phone-app/phone-app/vendor/sentry/sentry-symfony/src/Tracing/HttpClient/TraceableResponseForV4.php on line 15
Debugging in sentry-symfony library I found src/aliases.php file where the class TraceableResponseForV4 was added 🤓
So I realized that StreameableInterface was not added to my composer.json
After some browsing I found the class in Symfony Http Client library
So I added composer require symfony/http-client
And now the tests are green 🥳 We can use new Sentry version
How do you use Sentry?
Sentry SaaS (sentry.io)
SDK version
5.0.0
Steps to reproduce
I tried to Bump sentry/sentry-symfony from 4.14.0 to 5.0.0. When I run PHP-cs-fixer or PHPStan or any other command Then the result is a failure
I'm using
symfony/http-client-contracts
version 3.4.2 in composer.lockExpected result
A ok result when executing the command
This is signature of the method
getInfo
https://github.com/symfony/contracts/blob/main/HttpClient/ResponseInterface.php#L108Actual result