Skip to content
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

[6.x] Utilize Symfony’s PSR Factory #31018

Conversation

@ivannovak
Copy link

ivannovak commented Jan 3, 2020

  • replace DiactorosFactory with Symfony’s PSR Factory and recommended implementation
  • replace Diactoros Response with Nyholm’s Response per Symfony docs recommendation

Closes #31017.

Ivan Novak added 2 commits Jan 3, 2020
Ivan Novak
- replace DiactorosFactory with Symfony’s PSR Factory and recommended implementaiton
- replace Diactoros Resposne with Nyholm’s Response per Symfony docs recommendation
Ivan Novak
@GrahamCampbell GrahamCampbell changed the title Utilize Symfony’s PSR Factory. Fixes #31017 [6.x] Utilize Symfony’s PSR Factory. Fixes #31017 Jan 3, 2020
@GrahamCampbell

This comment has been minimized.

Copy link
Member

GrahamCampbell commented Jan 3, 2020

Thanks for the PR. Please update the suggest blocks in the composer.json file.

@GrahamCampbell

This comment has been minimized.

Copy link
Member

GrahamCampbell commented Jan 3, 2020

(in both composer.json files)

Ivan Novak added 2 commits Jan 3, 2020
Ivan Novak
Ivan Novak
- updated routing composer on psr-http-bridge language inline with base composer file
@ivannovak

This comment has been minimized.

Copy link
Author

ivannovak commented Jan 3, 2020

FYI - Updated composer files

@GrahamCampbell GrahamCampbell changed the title [6.x] Utilize Symfony’s PSR Factory. Fixes #31017 [6.x] Utilize Symfony’s PSR Factory Jan 3, 2020
@ivannovak ivannovak requested a review from GrahamCampbell Jan 3, 2020
@GrahamCampbell

This comment has been minimized.

Copy link
Member

GrahamCampbell commented Jan 3, 2020

Thanks for this. I've left some more comments. :)

if (class_exists(ZendPsrResponse::class)) {
return new ZendPsrResponse;
}

throw new Exception('Unable to resolve PSR response. Please install nyholm/psr7 or laminas/laminas-diactoros.');

This comment has been minimized.

Copy link
@GrahamCampbell

GrahamCampbell Jan 4, 2020

Member

Since we're not actually supporting zendframework/zend-diactoros as per the previous discussion, and the zend stuff is now deprecated, maybe we should only recommend nyholm/psr7 here?

This comment has been minimized.

Copy link
@GrahamCampbell

GrahamCampbell Jan 4, 2020

Member

So, we'll have:

Unable to resolve PSR response. Please install nyholm/psr7.
if (class_exists(DiactorosFactory::class)) {
return (new DiactorosFactory)->createRequest($app->make('request'));
}

throw new Exception('Unable to resolve PSR request. Please install nyholm/psr7 or laminas/laminas-diactoros.');

This comment has been minimized.

Copy link
@GrahamCampbell

GrahamCampbell Jan 4, 2020

Member

We should probably replace this message with:

Unable to resolve PSR request. Please install symfony/psr-http-message-bridge.

This comment has been minimized.

Copy link
@ivannovak

ivannovak Jan 4, 2020

Author

Probably should be both since that Psr17Factory comes from the nyholm package?

Unable to resolve PSR request. Please install symfony/psr-http-message-bridge and nyholm/psr7.
@taylorotwell taylorotwell merged commit 15d6744 into laravel:6.x Jan 4, 2020
2 checks passed
2 checks passed
continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.