Unverified Commit 05b122f2 authored by alexpott's avatar alexpott
Browse files

Issue #3043471 by longwave, catch, Wim Leers, xjm: Replace the...

Issue #3043471 by longwave, catch, Wim Leers, xjm: Replace the DiactorosFactory message factory in symfony/psr-http-message-bridge with a PSR-17 compliant message factory
parent ba351b47
......@@ -457,7 +457,7 @@
"dist": {
"type": "path",
"url": "core",
"reference": "1135d82ca80e22e7f25b1bd9a8613cae5ae06372"
"reference": "768f1baa1d20571f5f326b64ec749ddd5d1039fc"
},
"require": {
"asm89/stack-cors": "^1.1",
......@@ -494,7 +494,7 @@
"symfony/http-kernel": "^4.4",
"symfony/polyfill-iconv": "^1.0",
"symfony/process": "^4.4",
"symfony/psr-http-message-bridge": "^1.2.0",
"symfony/psr-http-message-bridge": "^2.0",
"symfony/routing": "^4.4",
"symfony/serializer": "^4.4",
"symfony/translation": "^4.4",
......@@ -2930,16 +2930,16 @@
},
{
"name": "symfony/psr-http-message-bridge",
"version": "v1.3.0",
"version": "v2.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/psr-http-message-bridge.git",
"reference": "9d3e80d54d9ae747ad573cad796e8e247df7b796"
"reference": "ce709cd9c90872c08c2427b45739d5f3c781ab4f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/9d3e80d54d9ae747ad573cad796e8e247df7b796",
"reference": "9d3e80d54d9ae747ad573cad796e8e247df7b796",
"url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/ce709cd9c90872c08c2427b45739d5f3c781ab4f",
"reference": "ce709cd9c90872c08c2427b45739d5f3c781ab4f",
"shasum": ""
},
"require": {
......@@ -2949,8 +2949,7 @@
},
"require-dev": {
"nyholm/psr7": "^1.1",
"symfony/phpunit-bridge": "^4.4 || ^5.0",
"zendframework/zend-diactoros": "^1.4.1 || ^2.0"
"symfony/phpunit-bridge": "^4.4 || ^5.0"
},
"suggest": {
"nyholm/psr7": "For a super lightweight PSR-7/17 implementation"
......@@ -2958,7 +2957,7 @@
"type": "symfony-bridge",
"extra": {
"branch-alias": {
"dev-master": "1.3-dev"
"dev-master": "2.0-dev"
}
},
"autoload": {
......@@ -2991,7 +2990,7 @@
"psr-17",
"psr-7"
],
"time": "2019-11-25T19:33:50+00:00"
"time": "2020-01-02T08:07:11+00:00"
},
{
"name": "symfony/routing",
......
......@@ -51,7 +51,7 @@
"symfony/polyfill-php72": "v1.14.0",
"symfony/polyfill-php73": "v1.14.0",
"symfony/process": "v4.4.4",
"symfony/psr-http-message-bridge": "v1.3.0",
"symfony/psr-http-message-bridge": "v2.0.0",
"symfony/routing": "v4.4.4",
"symfony/serializer": "v4.4.4",
"symfony/service-contracts": "v2.0.1",
......
......@@ -40,7 +40,7 @@
"stack/builder": "^1.0",
"egulias/email-validator": "^2.0",
"masterminds/html5": "^2.1",
"symfony/psr-http-message-bridge": "^1.2.0",
"symfony/psr-http-message-bridge": "^2.0",
"laminas/laminas-diactoros": "^2.1",
"composer/semver": "^1.0",
"asm89/stack-cors": "^1.1",
......
......@@ -786,8 +786,21 @@ services:
- { name: http_middleware, priority: 250 }
psr7.http_foundation_factory:
class: Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory
psr17.server_request_factory:
class: Laminas\Diactoros\ServerRequestFactory
public: false
psr17.stream_factory:
class: Laminas\Diactoros\StreamFactory
public: false
psr17.uploaded_file_factory:
class: Laminas\Diactoros\UploadedFileFactory
public: false
psr17.response_factory:
class: Laminas\Diactoros\ResponseFactory
public: false
psr7.http_message_factory:
class: Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory
class: Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory
arguments: ['@psr17.server_request_factory', '@psr17.stream_factory', '@psr17.uploaded_file_factory', '@psr17.response_factory']
language_manager:
class: Drupal\Core\Language\LanguageManager
arguments: ['@language.default']
......
......@@ -12,12 +12,16 @@
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Tests\UnitTestCase;
use Laminas\Diactoros\ResponseFactory;
use Laminas\Diactoros\ServerRequestFactory;
use Laminas\Diactoros\StreamFactory;
use Laminas\Diactoros\UploadedFileFactory;
use Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory;
use Psr\Http\Message\ServerRequestInterface;
/**
......@@ -56,7 +60,7 @@ protected function setUp() {
$this->container = new ContainerBuilder();
$class_resolver = new ClassResolver();
$class_resolver->setContainer($this->container);
$this->httpMessageFactory = new DiactorosFactory();
$this->httpMessageFactory = new PsrHttpFactory(new ServerRequestFactory(), new StreamFactory(), new UploadedFileFactory(), new ResponseFactory());
$this->controllerResolver = new ControllerResolver($this->httpMessageFactory, $class_resolver);
}
......
......@@ -139,11 +139,6 @@ public static function getSkippedDeprecations() {
return [
// The following deprecation message is skipped for testing purposes.
'\Drupal\Tests\SkippedDeprecationTest deprecation',
// These deprecations are triggered by symfony/psr-http-message-factory
// 1.2, which can be installed if you update dependencies on php 7 or
// higher.
'The "Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory" class is deprecated since symfony/psr-http-message-bridge 1.2, use PsrHttpFactory instead.',
'The "psr7.http_message_factory" service relies on the deprecated "Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory" class. It should either be deprecated or its implementation upgraded.',
// This deprecation comes from behat/mink-browserkit-driver when updating
// symfony/browser-kit to 4.3+.
'The "Symfony\Component\BrowserKit\Response::getStatus()" method is deprecated since Symfony 4.3, use getStatusCode() instead.',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment