From 3dbdb254acdd54a4d5a1e1d150b65148696e6b7f Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Tue, 10 Sep 2024 15:24:04 +1200 Subject: [PATCH] API Deprecate API that will be removed --- src/Task/ConvertTranslatableTask.php | 15 +++++++++++++++ src/Task/ConvertTranslatableTask/Exception.php | 17 ++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/Task/ConvertTranslatableTask.php b/src/Task/ConvertTranslatableTask.php index 95ee3241..0980b6c0 100644 --- a/src/Task/ConvertTranslatableTask.php +++ b/src/Task/ConvertTranslatableTask.php @@ -6,6 +6,7 @@ use SilverStripe\Core\Convert; use SilverStripe\Dev\BuildTask; use SilverStripe\Dev\Debug; +use SilverStripe\Dev\Deprecation; use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DB; use SilverStripe\ORM\Queries\SQLSelect; @@ -31,6 +32,8 @@ * 3. Log into the CMS and set up the locales you want to use * 4. Back up your DB again * 5. Log into the CMS and check everything + * + * @deprecated 7.3.0 Will be removed without equivalent functionality to replace it */ class ConvertTranslatableTask extends BuildTask { @@ -40,6 +43,18 @@ class ConvertTranslatableTask extends BuildTask private static $segment = 'ConvertTranslatableTask'; + public function __construct() + { + parent::__construct(); + Deprecation::withNoReplacement(function () { + Deprecation::notice( + '7.3.0', + 'Will be removed without equivalent functionality to replace it', + Deprecation::SCOPE_CLASS + ); + }); + } + /** * Checks that fluent is configured correctly * diff --git a/src/Task/ConvertTranslatableTask/Exception.php b/src/Task/ConvertTranslatableTask/Exception.php index de97fd5d..a61c1292 100644 --- a/src/Task/ConvertTranslatableTask/Exception.php +++ b/src/Task/ConvertTranslatableTask/Exception.php @@ -2,7 +2,22 @@ namespace TractorCow\Fluent\Task\ConvertTranslatableTask; +use SilverStripe\Dev\Deprecation; + +/** + * @deprecated 7.3.0 Will be removed without equivalent functionality to replace it + */ class Exception extends \Exception { - + public function __construct() + { + parent::__construct(); + Deprecation::withNoReplacement(function () { + Deprecation::notice( + '7.3.0', + 'Will be removed without equivalent functionality to replace it', + Deprecation::SCOPE_CLASS + ); + }); + } }