From f82e28c5333f3d9d069522119819b38b6fecee84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Fri, 28 Jun 2019 15:18:47 +0200 Subject: [PATCH] [HttpFoundation] Deprecated ApacheRequest --- UPGRADE-4.4.md | 13 +++++++++---- UPGRADE-5.0.md | 5 ++--- .../Component/HttpFoundation/ApacheRequest.php | 4 ++++ src/Symfony/Component/HttpFoundation/CHANGELOG.md | 1 + .../HttpFoundation/Tests/ApacheRequestTest.php | 1 + 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/UPGRADE-4.4.md b/UPGRADE-4.4.md index 96c170675cf6..d745ce32522f 100644 --- a/UPGRADE-4.4.md +++ b/UPGRADE-4.4.md @@ -26,7 +26,7 @@ DependencyInjection services: App\Handler: tags: ['app.handler'] - + App\HandlerCollection: arguments: [!tagged app.handler] ``` @@ -36,7 +36,7 @@ DependencyInjection services: App\Handler: tags: ['app.handler'] - + App\HandlerCollection: arguments: [!tagged_iterator app.handler] ``` @@ -60,6 +60,11 @@ HttpClient * Added method `cancel()` to `ResponseInterface` +HttpFoundation +-------------- + + * `ApacheRequest` is deprecated, use `Request` class instead. + HttpKernel ---------- @@ -84,11 +89,11 @@ Security TwigBridge ---------- - * Deprecated to pass `$rootDir` and `$fileLinkFormatter` as 5th and 6th argument respectively to the + * Deprecated to pass `$rootDir` and `$fileLinkFormatter` as 5th and 6th argument respectively to the `DebugCommand::__construct()` method, swap the variables position. Validator --------- - * Deprecated passing an `ExpressionLanguage` instance as the second argument of `ExpressionValidator::__construct()`. + * Deprecated passing an `ExpressionLanguage` instance as the second argument of `ExpressionValidator::__construct()`. Pass it as the first argument instead. diff --git a/UPGRADE-5.0.md b/UPGRADE-5.0.md index bb6f87dd0087..a396c7edcc43 100644 --- a/UPGRADE-5.0.md +++ b/UPGRADE-5.0.md @@ -101,7 +101,7 @@ DependencyInjection services: App\Handler: tags: ['app.handler'] - + App\HandlerCollection: arguments: [!tagged_iterator app.handler] ``` @@ -114,7 +114,6 @@ DoctrineBridge * Passing an `IdReader` to the `DoctrineChoiceLoader` when the query cannot be optimized with single id field will throw an exception, pass `null` instead * Not passing an `IdReader` to the `DoctrineChoiceLoader` when the query can be optimized with single id field will not apply any optimization - DomCrawler ---------- @@ -268,6 +267,7 @@ HttpFoundation use `Symfony\Component\Mime\FileBinaryMimeTypeGuesser` instead. * The `FileinfoMimeTypeGuesser` class has been removed, use `Symfony\Component\Mime\FileinfoMimeTypeGuesser` instead. + * `ApacheRequest` has been removed, use the `Request` class instead. HttpKernel ---------- @@ -518,7 +518,6 @@ Workflow property: state ``` - * Support for using a workflow with a single state marking is dropped. Use a state machine instead. Before: diff --git a/src/Symfony/Component/HttpFoundation/ApacheRequest.php b/src/Symfony/Component/HttpFoundation/ApacheRequest.php index 4e99186dcd50..f189cde585b1 100644 --- a/src/Symfony/Component/HttpFoundation/ApacheRequest.php +++ b/src/Symfony/Component/HttpFoundation/ApacheRequest.php @@ -11,9 +11,13 @@ namespace Symfony\Component\HttpFoundation; +@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', ApacheRequest::class, Request::class), E_USER_DEPRECATED); + /** * Request represents an HTTP request from an Apache server. * + * @deprecated since Symfony 4.4. Use the Request class instead. + * * @author Fabien Potencier */ class ApacheRequest extends Request diff --git a/src/Symfony/Component/HttpFoundation/CHANGELOG.md b/src/Symfony/Component/HttpFoundation/CHANGELOG.md index 7ecbdffa9e2b..29e06e678cdc 100644 --- a/src/Symfony/Component/HttpFoundation/CHANGELOG.md +++ b/src/Symfony/Component/HttpFoundation/CHANGELOG.md @@ -5,6 +5,7 @@ CHANGELOG ----- * passing arguments to `Request::isMethodSafe()` is deprecated. + * `ApacheRequest` is deprecated, use the `Request` class instead. 4.3.0 ----- diff --git a/src/Symfony/Component/HttpFoundation/Tests/ApacheRequestTest.php b/src/Symfony/Component/HttpFoundation/Tests/ApacheRequestTest.php index 6fa3b8891705..7a5bd378a200 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/ApacheRequestTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/ApacheRequestTest.php @@ -14,6 +14,7 @@ use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\ApacheRequest; +/** @group legacy */ class ApacheRequestTest extends TestCase { /**