Increase minimum required PHP version to 7.4#14
Increase minimum required PHP version to 7.4#14haiduk-paysera wants to merge 5 commits intopaysera:masterfrom
Conversation
composer.json
Outdated
| }, | ||
| "require": { | ||
| "php": "^7.2 || ^8.0", | ||
| "php": "^7.4 || ^8.0", |
There was a problem hiding this comment.
Just set requirement to >=7.4, that way lib will be compatible with PHP 7, 8, 9, 10 etc. versions
| @@ -38,7 +38,7 @@ class CorrelationIdListener | |||
| { | |||
| public const HEADER_NAME = 'Paysera-Correlation-Id'; | |||
There was a problem hiding this comment.
there are differences between two declared classes, it would be better to just declare class once and fix different class problem via aliasing, eg.
use Symfony\Component\HttpKernel\Event\ResponseEvent as SymfonyResponseEvent;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent as SymfonyFilterResponseEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface;
if (class_exists(SymfonyResponseEvent::class)) {
class_alias(SymfonyResponseEvent::class, 'BaseResponseEvent');
} else {
class_alias(SymfonyFilterResponseEvent::class, 'BaseResponseEvent');
}
class CorrelationIdListener
{
public function onKernelResponse(BaseResponseEvent $event)
{
if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
return;
}
// ...
}
}
There was a problem hiding this comment.
Good point. I've found we can get rid of conditional classes at all.
The FilterResponseEvent is actual for symfony/http-kernel 3.x and till 4.3
The support of symfony/http-kernel ^3.4 is dropped because of conflicts in dependencies.
The minimum allowable 4.x version of symfony/http-kernel is ^4.4.11 because of "sentry/sentry-symfony": "^4.0"
sentry/sentry-symfony[4.0.0, ..., 4.0.3] require symfony/http-kernel ^3.4.43||^4.4.11||^5.0.11 -> found symfony/http-kernel[v3.4.43, ..., v3.4.49, v4.4.11, ..., v4.4.51, v5.0.11, ..., v5.4.48] but it conflicts with your root composer.json require (4.0.*).
So in the symfony/http-kernel 4.4.11, the ResponseEvent already exists, see repo and the article
|
Relevant changes implemented in #18 |
Dependencies versions changes:
"monolog/monolog": "^1.24"does not work anymore becauseSentryExtraInformationHandlerusesProcessableHandlerTrait, which is not present in this version"monolog/monolog"increased from2.0.0to2.1.0, because2.0.0does not haveUtils::jsonEncode()which is used in\Paysera\LoggingExtraBundle\Service\Formatter\FormatterTrait::toJson"symfony/http-kernel": "^3.4"is not supported anymore because it conflicts with other dependencies (symfony/monolog-bundle,symfony/monolog-bridge)