From cd7f4efdda338f630d3dfe0f2a55b80aa6830f4d Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Fri, 13 Sep 2024 17:18:36 +1200 Subject: [PATCH] API Deprecate API that will be removed (#94) --- src/Controllers/CronTaskController.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Controllers/CronTaskController.php b/src/Controllers/CronTaskController.php index 6127482..d68a3f5 100644 --- a/src/Controllers/CronTaskController.php +++ b/src/Controllers/CronTaskController.php @@ -13,6 +13,7 @@ use SilverStripe\Core\Injector\Injector; use SilverStripe\CronTask\CronTaskStatus; use SilverStripe\CronTask\Interfaces\CronTask; +use SilverStripe\Dev\Deprecation; use SilverStripe\ORM\FieldType\DBDatetime; use SilverStripe\Security\Permission; use SilverStripe\Security\Security; @@ -22,6 +23,7 @@ * * The default route to this controller is 'dev/cron' * + * @deprecated 3.1.0 Will be replaced with SilverStripe\CronTask\Cli\CronTaskCommand */ class CronTaskController extends Controller { @@ -32,6 +34,18 @@ class CronTaskController extends Controller */ protected $verbosity = 1; + public function __construct() + { + parent::__construct(); + Deprecation::withNoReplacement(function () { + Deprecation::notice( + '3.1.0', + 'Will be replaced with SilverStripe\CronTask\Cli\CronTaskCommand', + Deprecation::SCOPE_CLASS + ); + }); + } + /** * Tell the controller how noisy it may be *