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
Changes from 1 commit
6403676
7ff1325
98936ee
69700fe
377dffb
a976157
3e25c98
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
namespace Illuminate\Routing; | ||
|
||
use Exception; | ||
use Illuminate\Contracts\Routing\ResponseFactory as ResponseFactoryContract; | ||
use Illuminate\Contracts\Routing\UrlGenerator as UrlGeneratorContract; | ||
use Illuminate\Contracts\View\Factory as ViewFactoryContract; | ||
|
@@ -137,9 +138,12 @@ protected function registerPsrRequest() | |
return (new PsrHttpFactory($psr17Factory, $psr17Factory, $psr17Factory, $psr17Factory)) | ||
->createRequest($app->make('request')); | ||
} | ||
|
||
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.'); | ||
}); | ||
} | ||
|
||
|
@@ -154,9 +158,12 @@ protected function registerPsrResponse() | |
if (class_exists(NyholmPsrResponse::class)) { | ||
return new NyholmPsrResponse; | ||
} | ||
|
||
if (class_exists(ZendPsrResponse::class)) { | ||
return new ZendPsrResponse; | ||
} | ||
GrahamCampbell marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
throw new Exception('Unable to resolve PSR response. Please install nyholm/psr7 or laminas/laminas-diactoros.'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we're not actually supporting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, we'll have:
|
||
}); | ||
} | ||
|
||
|
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.
We should probably replace this message with:
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.
Probably should be both since that Psr17Factory comes from the nyholm package?