From b19510ee3cc45da9e6637f57924b52f1de1280d5 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Wed, 18 Sep 2024 10:53:32 +1200 Subject: [PATCH] ENH Don't use deprecated method --- code/Controller/AssetAdmin.php | 2 +- code/Controller/AssetAdminFieldsExtension.php | 2 +- code/GraphQL/FileFilter.php | 2 +- code/GraphQL/Notice.php | 2 +- code/GraphQL/Resolvers/AssetAdminResolver.php | 4 ++-- code/GraphQL/Resolvers/FieldResolver.php | 2 +- code/GraphQL/Resolvers/FileTypeResolver.php | 2 +- code/GraphQL/Resolvers/FolderTypeResolver.php | 2 +- code/GraphQL/Resolvers/PublicationResolver.php | 2 +- code/GraphQL/Schema/Builder.php | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/code/Controller/AssetAdmin.php b/code/Controller/AssetAdmin.php index 5ae2da7b5..76d4864d9 100644 --- a/code/Controller/AssetAdmin.php +++ b/code/Controller/AssetAdmin.php @@ -1083,7 +1083,7 @@ public function getObjectFromData(File $file, $thumbnailLinks = true) $object['url'] = $file->AbsoluteURL; $object['canEdit'] = $file->canEdit(); $object['canDelete'] = ($file->hasMethod('canArchive')) - ? Deprecation::withNoReplacement(fn() => $file->canArchive()) + ? Deprecation::withSuppressedNotice(fn() => $file->canArchive()) : $file->canDelete(); $owner = $file->Owner(); diff --git a/code/Controller/AssetAdminFieldsExtension.php b/code/Controller/AssetAdminFieldsExtension.php index fe50e8cea..441f4d2f7 100644 --- a/code/Controller/AssetAdminFieldsExtension.php +++ b/code/Controller/AssetAdminFieldsExtension.php @@ -15,7 +15,7 @@ class AssetAdminFieldsExtension extends Extension { public function __construct() { - Deprecation::withNoReplacement( + Deprecation::withSuppressedNotice( fn () => Deprecation::notice('5.3.0', 'Will be replaced with YAML configuration', Deprecation::SCOPE_CLASS) ); parent::__construct(); diff --git a/code/GraphQL/FileFilter.php b/code/GraphQL/FileFilter.php index 28510fcdf..242f14ab0 100644 --- a/code/GraphQL/FileFilter.php +++ b/code/GraphQL/FileFilter.php @@ -19,7 +19,7 @@ class FileFilter { public function __construct() { - Deprecation::withNoReplacement(function () { + Deprecation::withSuppressedNotice(function () { Deprecation::notice('2.3.0', 'Will be moved to the silverstripe/graphql module', Deprecation::SCOPE_CLASS); }); } diff --git a/code/GraphQL/Notice.php b/code/GraphQL/Notice.php index b13b74b7d..9c631151d 100644 --- a/code/GraphQL/Notice.php +++ b/code/GraphQL/Notice.php @@ -38,7 +38,7 @@ class Notice */ public function __construct($message, $noticeType, $ids = []) { - Deprecation::withNoReplacement(function () { + Deprecation::withSuppressedNotice(function () { Deprecation::notice('2.3.0', 'Will be moved to the silverstripe/graphql module', Deprecation::SCOPE_CLASS); }); $this->message = $message; diff --git a/code/GraphQL/Resolvers/AssetAdminResolver.php b/code/GraphQL/Resolvers/AssetAdminResolver.php index c39a74124..f4e6cc356 100644 --- a/code/GraphQL/Resolvers/AssetAdminResolver.php +++ b/code/GraphQL/Resolvers/AssetAdminResolver.php @@ -25,7 +25,7 @@ class AssetAdminResolver { public function __construct() { - Deprecation::withNoReplacement(function () { + Deprecation::withSuppressedNotice(function () { Deprecation::notice('2.3.0', 'Will be moved to the silverstripe/graphql module', Deprecation::SCOPE_CLASS); }); } @@ -137,7 +137,7 @@ public static function resolveDeleteFiles($object, array $args, $context, Resolv $deletedIDs = []; $member = UserContextProvider::get($context); foreach ($files as $file) { - $canArchive = Deprecation::withNoReplacement(fn() => $file->canArchive($member)); + $canArchive = Deprecation::withSuppressedNotice(fn() => $file->canArchive($member)); if ($canArchive) { $file->doArchive(); $deletedIDs[] = $file->ID; diff --git a/code/GraphQL/Resolvers/FieldResolver.php b/code/GraphQL/Resolvers/FieldResolver.php index d4cd23aa8..9ff27134c 100644 --- a/code/GraphQL/Resolvers/FieldResolver.php +++ b/code/GraphQL/Resolvers/FieldResolver.php @@ -14,7 +14,7 @@ class FieldResolver { public function __construct() { - Deprecation::withNoReplacement(function () { + Deprecation::withSuppressedNotice(function () { Deprecation::notice('2.3.0', 'Will be moved to the silverstripe/graphql module', Deprecation::SCOPE_CLASS); }); } diff --git a/code/GraphQL/Resolvers/FileTypeResolver.php b/code/GraphQL/Resolvers/FileTypeResolver.php index 48f0841ee..7653fe4b6 100644 --- a/code/GraphQL/Resolvers/FileTypeResolver.php +++ b/code/GraphQL/Resolvers/FileTypeResolver.php @@ -23,7 +23,7 @@ class FileTypeResolver public function __construct() { - Deprecation::withNoReplacement(function () { + Deprecation::withSuppressedNotice(function () { Deprecation::notice('2.3.0', 'Will be moved to the silverstripe/graphql module', Deprecation::SCOPE_CLASS); }); } diff --git a/code/GraphQL/Resolvers/FolderTypeResolver.php b/code/GraphQL/Resolvers/FolderTypeResolver.php index 6aca49e27..e76d3db54 100644 --- a/code/GraphQL/Resolvers/FolderTypeResolver.php +++ b/code/GraphQL/Resolvers/FolderTypeResolver.php @@ -28,7 +28,7 @@ class FolderTypeResolver { public function __construct() { - Deprecation::withNoReplacement(function () { + Deprecation::withSuppressedNotice(function () { Deprecation::notice('2.3.0', 'Will be moved to the silverstripe/graphql module', Deprecation::SCOPE_CLASS); }); } diff --git a/code/GraphQL/Resolvers/PublicationResolver.php b/code/GraphQL/Resolvers/PublicationResolver.php index 1500cd8fc..85d33e9f7 100644 --- a/code/GraphQL/Resolvers/PublicationResolver.php +++ b/code/GraphQL/Resolvers/PublicationResolver.php @@ -23,7 +23,7 @@ class PublicationResolver public function __construct() { - Deprecation::withNoReplacement(function () { + Deprecation::withSuppressedNotice(function () { Deprecation::notice('2.3.0', 'Will be moved to the silverstripe/graphql module', Deprecation::SCOPE_CLASS); }); } diff --git a/code/GraphQL/Schema/Builder.php b/code/GraphQL/Schema/Builder.php index 0d0e7df1b..de4bdfc96 100644 --- a/code/GraphQL/Schema/Builder.php +++ b/code/GraphQL/Schema/Builder.php @@ -21,7 +21,7 @@ class Builder implements SchemaUpdater { public function __construct() { - Deprecation::withNoReplacement(function () { + Deprecation::withSuppressedNotice(function () { Deprecation::notice('2.3.0', 'Will be moved to the silverstripe/graphql module', Deprecation::SCOPE_CLASS); }); }