From 0d959a3141861486eccace06f446585608c3bd83 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Thu, 24 Oct 2024 10:34:33 +1300 Subject: [PATCH] API Deprecate FlushMiddelware --- src/Control/Middleware/FlushMiddleware.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Control/Middleware/FlushMiddleware.php b/src/Control/Middleware/FlushMiddleware.php index 374063eec36..c14fd319df6 100644 --- a/src/Control/Middleware/FlushMiddleware.php +++ b/src/Control/Middleware/FlushMiddleware.php @@ -3,17 +3,23 @@ namespace SilverStripe\Control\Middleware; use SilverStripe\Control\HTTPRequest; -use SilverStripe\Core\BaseKernel; use SilverStripe\Core\ClassInfo; use SilverStripe\Core\Flushable; use SilverStripe\Core\Injector\Injector; use SilverStripe\Core\Kernel; +use SilverStripe\Dev\Deprecation; /** * Triggers a call to flush() on all implementors of Flushable. + * @deprecated 5.4.0 Will be replaced with flushing inside the Kernel directly. */ class FlushMiddleware implements HTTPMiddleware { + public function __construct() + { + Deprecation::noticeWithNoReplacment('5.4.0', 'Will be replaced with flushing inside the Kernel directly.'); + } + public function process(HTTPRequest $request, callable $delegate) { $kernel = Injector::inst()->get(Kernel::class);