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

[7.x] Removed legacy HTTP PSR code #31028

Merged
merged 1 commit into from
Jan 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
"psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).",
"pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^4.0).",
"symfony/cache": "Required to PSR-6 cache bridge (^5.0).",
"symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^1.2).",
"symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0).",
"wildbit/swiftmailer-postmark": "Required to use Postmark mail driver (^3.0)."
},
"config": {
Expand Down
17 changes: 3 additions & 14 deletions src/Illuminate/Routing/RoutingServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@
use Illuminate\Routing\Contracts\ControllerDispatcher as ControllerDispatcherContract;
use Illuminate\Support\ServiceProvider;
use Nyholm\Psr7\Factory\Psr17Factory;
use Nyholm\Psr7\Response as NyholmPsrResponse;
use Nyholm\Psr7\Response as PsrResponse;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory;
use Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory;
use Zend\Diactoros\Response as ZendPsrResponse;
use Zend\Diactoros\ServerRequestFactory;

class RoutingServiceProvider extends ServiceProvider
{
Expand Down Expand Up @@ -140,10 +137,6 @@ protected function registerPsrRequest()
->createRequest($app->make('request'));
}

if (class_exists(ServerRequestFactory::class) && class_exists(DiactorosFactory::class)) {
return (new DiactorosFactory)->createRequest($app->make('request'));
}

throw new Exception('Unable to resolve PSR request. Please install symfony/psr-http-message-bridge and nyholm/psr7.');
});
}
Expand All @@ -156,12 +149,8 @@ protected function registerPsrRequest()
protected function registerPsrResponse()
{
$this->app->bind(ResponseInterface::class, function () {
if (class_exists(NyholmPsrResponse::class)) {
return new NyholmPsrResponse;
}

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

throw new Exception('Unable to resolve PSR response. Please install nyholm/psr7.');
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Routing/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"suggest": {
"illuminate/console": "Required to use the make commands (^7.0).",
"nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).",
"symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^1.2)."
"symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0)."
},
"config": {
"sort-packages": true
Expand Down