From 611dc588e0c4138ff74a07b896db54d951c03058 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Tue, 20 Aug 2024 14:11:06 +1200 Subject: [PATCH] API Deprecate LeftAndMainExtension --- code/LeftAndMainExtension.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/code/LeftAndMainExtension.php b/code/LeftAndMainExtension.php index 62835f1e4..9effb2106 100644 --- a/code/LeftAndMainExtension.php +++ b/code/LeftAndMainExtension.php @@ -3,15 +3,28 @@ namespace SilverStripe\Admin; use SilverStripe\Core\Extension; +use SilverStripe\Dev\Deprecation; /** * Plug-ins for additional functionality in your LeftAndMain classes. * * @template T of LeftAndMain * @extends Extension + * @deprecated 2.3.0 Subclass SilverStripe\Core\Extension\Extension instead */ abstract class LeftAndMainExtension extends Extension { + public function __construct() + { + // Wrapping with Deprecation::withNoReplacement() to avoid triggering deprecation notices + // as we are unable to update existing subclasses of this class until a new major + // unless we add in the pointless empty methods that are in this class + Deprecation::withNoReplacement(function () { + $class = Extension::class; + Deprecation::notice('2.3.0', "Subclass $class instead", Deprecation::SCOPE_CLASS); + }); + parent::__construct(); + } public function init() {