From ea43504801aab08b7d1d7b0f7484eb398c769b83 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Wed, 18 Sep 2024 10:53:02 +1200 Subject: [PATCH] ENH Don't use deprecated method --- 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..521f862 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::withSuppressedWarning(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..8036daa 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::withSuppressedWarning(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::withSuppressedWarning(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::withSuppressedWarning(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::withSuppressedWarning(function () { $this->log(StaticCacheFullBuildJob::class . ' added to the queue for immediate processing'); }); }