From 701ae8b8e4f2ca8e489b90aa934665d7263bf6d1 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Thu, 19 Sep 2024 14:04:40 +1200 Subject: [PATCH 1/2] ENH Don't use deprecated method (#1497) --- 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); }); } From b6a2dc28a4b80387d4cfae9a1080a4d86094998a Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Mon, 23 Sep 2024 15:14:37 +1200 Subject: [PATCH 2/2] DEP Increase minimum version of silverstripe/framework --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7d3d7d021..1ee658f77 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "license": "BSD-3-Clause", "require": { "php": "^8.1", - "silverstripe/framework": "^5.2", + "silverstripe/framework": "^5.4", "silverstripe/admin": "^2.2", "silverstripe/graphql": "^5" },