From b8c73479a1edb70afd5ba8da85a76a53a03d60d7 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Thu, 19 Sep 2024 11:27:26 +1200 Subject: [PATCH] ENH Don't use deprecated method (#205) --- src/Extension/Engine/SiteTreePublishingEngine.php | 2 +- src/Task/StaticCacheFullBuildTask.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Extension/Engine/SiteTreePublishingEngine.php b/src/Extension/Engine/SiteTreePublishingEngine.php index b566d56..669ac42 100644 --- a/src/Extension/Engine/SiteTreePublishingEngine.php +++ b/src/Extension/Engine/SiteTreePublishingEngine.php @@ -284,7 +284,7 @@ public function collectChanges($context) } // Fetch our objects to be actioned - Deprecation::withNoReplacement(function () use ($siteTree, $context): void { + Deprecation::withSuppressedNotice(function () use ($siteTree, $context): void { $this->setToUpdate($siteTree->objectsToUpdate($context)); $this->setToDelete($siteTree->objectsToDelete($context)); }); diff --git a/src/Task/StaticCacheFullBuildTask.php b/src/Task/StaticCacheFullBuildTask.php index 172947b..63e1ee4 100644 --- a/src/Task/StaticCacheFullBuildTask.php +++ b/src/Task/StaticCacheFullBuildTask.php @@ -43,7 +43,7 @@ public function run($request) $existing = DataList::create(QueuedJobDescriptor::class)->filter($filter)->first(); if ($existing && $existing->exists()) { - Deprecation::withNoReplacement(function () use ($existing) { + Deprecation::withSuppressedNotice(function () use ($existing) { $this->log(sprintf( 'There is already a %s in the queue, added %s %s', StaticCacheFullBuildJob::class, @@ -74,14 +74,14 @@ public function run($request) // sanity check that we are in the next 24 hours - prevents some weird stuff sneaking through if ($startAfter->getTimestamp() > $thisTimeTomorrow || $startAfter->getTimestamp() < $now->getTimestamp()) { - Deprecation::withNoReplacement(function () { + Deprecation::withSuppressedNotice(function () { $this->log('Invalid startAfter parameter passed. Please ensure the time format is HHmm e.g. 1300'); }); return false; } - Deprecation::withNoReplacement(function () use ($startAfter, $dayWord) { + Deprecation::withSuppressedNotice(function () use ($startAfter, $dayWord) { $this->log(sprintf( '%s queued for %s %s.', StaticCacheFullBuildJob::class, @@ -91,7 +91,7 @@ public function run($request) }); } else { $startAfter = null; - Deprecation::withNoReplacement(function () { + Deprecation::withSuppressedNotice(function () { $this->log(StaticCacheFullBuildJob::class . ' added to the queue for immediate processing'); }); }