-
Notifications
You must be signed in to change notification settings - Fork 50
feat: Support Symfony 7 #445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
4e40422
to
cec9447
Compare
Have you tried this in a real project? |
So far not no, I'm kind of relying on the tests here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks a lot!
i checked in the build output, we indeed build with symfony 7 when we don't restrict the version. so this is looking good!
i don't fully trust the CI on this, would be glad if you can try your branch in a project to see if it really works.
(if you can run your tests locally, the easiest is to rm -r vendor/php-http/httplug-bundle && composer install --prefer-source
and then you can use git commands inside the folder to add your repo as additional remote and checkout your branch.)
@@ -134,7 +134,8 @@ protected static function bootKernel(array $options = []): KernelInterface | |||
$dispatcher = static::$kernel->getContainer()->get('event_dispatcher'); | |||
|
|||
$class = (Kernel::MAJOR_VERSION >= 5) ? RequestEvent::class : GetResponseEvent::class; | |||
$event = new $class(static::$kernel, SymfonyRequest::create('/'), HttpKernelInterface::MASTER_REQUEST); | |||
$requestType = (Kernel::MAJOR_VERSION >= 7) ? HttpKernelInterface::MAIN_REQUEST : HttpKernelInterface::MASTER_REQUEST; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$requestType = (Kernel::MAJOR_VERSION >= 7) ? HttpKernelInterface::MAIN_REQUEST : HttpKernelInterface::MASTER_REQUEST; | |
$requestType = (Kernel::MAJOR_VERSION >= 6) ? HttpKernelInterface::MAIN_REQUEST : HttpKernelInterface::MASTER_REQUEST; | |
main was introduced in symfony 5.3, and master is deprecated since then. lets use it from symfony 6 on.
If you're fine with some skeleton app testing, I don't have a SF7 ready project atm (still waiting on/need to commit to some other bundles so I can update them) |
glad if you can give it a quick spin in a skeleton, yes. then at least we notice if something obvious is broken. after that, we can release bugfix versions if something more complicated comes up. |
@dbu Seems to work fine. I made a symfony HTTP Methods client with it: http_methods_client: true
factory: 'httplug.factory.symfony' added some plugins (host, headers) and then did a get request I copied over from another project of mine. No errors, got the expected results and profiler works as well. |
thanks a lot for checking it up! released https://github.com/php-http/HttplugBundle/releases/tag/1.32.0 |
What's in this PR?
Support for Symfony 7
Why?
Because it got released
Checklist