Skip to content

Commit

Permalink
ENH Don't use deprecated method
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Sep 17, 2024
1 parent d42ca25 commit ea43504
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Extension/Engine/SiteTreePublishingEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
});
Expand Down
8 changes: 4 additions & 4 deletions src/Task/StaticCacheFullBuildTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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');
});
}
Expand Down

0 comments on commit ea43504

Please sign in to comment.