laravel / lumen-framework

The Laravel Lumen Framework.
https://lumen.laravel.com
MIT License
1.48k stars 419 forks source link

(Deprecated) class 'DiactorosFactory' missing when using symfony/psr-http-message-bridge v2.0.0 #1027

Closed boywijnmaalen closed 4 years ago

boywijnmaalen commented 4 years ago

Description:

I'm implementing the league/oauth2-server package in my lumen app. Since league/oauth2-server requires a PSR7 response I've (composer) required the package 'symfony/psr-http-message-bridge' as it is referenced in App::registerPsrRequestBindings().

However the class DiactorosFactory referenced in App::registerPsrRequestBindings() is no longer part of package symfony/psr-http-message-bridge V2.0.0 (the 'DiactorosFactory' class was already deprecated as of version symfony/psr-http-message-bridge v1.2.0).

Steps To Reproduce:

To be honest I'm not sure if this is a bug, because I could simply require symfony/psr-http-message-bridge v1.3.0 - which still contains the deprecated 'DiactorosFactory' class.

However I make it a habit of using the latest greatest for each dependency I use.

I've a working implementation using symfony/psr-http-message-bridge v2.0.0. I matched my implementation to https://symfony.com/doc/current/components/psr7.html#usage

I'm willing to make a PR if you guys agree with me symfony/psr-http-message-bridge v2.0.0 should be used over symfony/psr-http-message-bridge v1.3.0 when using Laravel Lumen.

driesvints commented 4 years ago

Zend\Diactoros\Response will also need to be replaced with the new Laminas package. Since we don't require these components directly we'll need to backport support for both in 6.x and drop support in 7.0.

driesvints commented 4 years ago

Feel free to send in a PR.

boywijnmaalen commented 4 years ago

@driesvints

Do you prefer the use 'Nyholm/Psr7' or specifically 'laminas/laminas-diactoros'?

'symfony/psr-http-message-bridge' suggests 'Nyholm/Psr7'.

'laminas/laminas-diactoros' requires another - in my opinion - unnecessary package.

driesvints commented 4 years ago

Nyholm/Psr7 because we also use that in framework. Thanks!