From 3030051c90dbbc4c56bd99a54e1f9d63af994aa7 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Wed, 18 Sep 2024 10:53:58 +1200 Subject: [PATCH] ENH Don't use deprecated method --- src/Extensions/ElementalLeftAndMainExtension.php | 2 +- src/GraphQL/Resolvers/Resolver.php | 2 +- src/Models/BaseElement.php | 6 +++--- src/ORM/FieldType/DBObjectType.php | 2 +- src/TopPage/DataExtension.php | 2 +- src/TopPage/FluentExtension.php | 2 +- src/TopPage/SiteTreeExtension.php | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Extensions/ElementalLeftAndMainExtension.php b/src/Extensions/ElementalLeftAndMainExtension.php index a98c6fa3..79deab2e 100644 --- a/src/Extensions/ElementalLeftAndMainExtension.php +++ b/src/Extensions/ElementalLeftAndMainExtension.php @@ -15,7 +15,7 @@ class ElementalLeftAndMainExtension extends Extension { public function __construct() { - Deprecation::withNoReplacement( + Deprecation::withSuppressedWarning( fn () => Deprecation::notice('5.3.0', 'Will be replaced with YAML configuration', Deprecation::SCOPE_CLASS) ); parent::__construct(); diff --git a/src/GraphQL/Resolvers/Resolver.php b/src/GraphQL/Resolvers/Resolver.php index 91ecd150..e15644bf 100644 --- a/src/GraphQL/Resolvers/Resolver.php +++ b/src/GraphQL/Resolvers/Resolver.php @@ -21,7 +21,7 @@ class Resolver { public function __construct() { - Deprecation::withNoReplacement(function () { + Deprecation::withSuppressedWarning(function () { $message = 'Will be removed without equivalent functionality to replace it'; Deprecation::notice('5.3.0', $message, Deprecation::SCOPE_CLASS); }); diff --git a/src/Models/BaseElement.php b/src/Models/BaseElement.php index 004d6d8a..6b12faee 100644 --- a/src/Models/BaseElement.php +++ b/src/Models/BaseElement.php @@ -278,7 +278,7 @@ public function canDelete($member = null) if ($this->hasMethod('getPage')) { if ($page = $this->getPage()) { if ($page->hasExtension(Versioned::class)) { - return Deprecation::withNoReplacement(fn() => $page->canArchive($member)); + return Deprecation::withSuppressedWarning(fn() => $page->canArchive($member)); } else { return $page->canDelete($member); } @@ -1166,7 +1166,7 @@ public function getDescription() */ public function getTypeNice() { - $description = Deprecation::withNoReplacement(fn () => $this->getDescription()); + $description = Deprecation::withSuppressedWarning(fn () => $this->getDescription()); $desc = ($description) ? ' — ' . $description . '' : ''; return DBField::create_field( @@ -1285,7 +1285,7 @@ public function EvenOdd() */ public static function getGraphQLTypeName(): string { - Deprecation::withNoReplacement(function () { + Deprecation::withSuppressedWarning(function () { Deprecation::notice('5.3.0', 'Will be replaced with getTypeName()'); }); // For GraphQL 3, use the static schema type name - except for BaseElement for which this is inconsistent. diff --git a/src/ORM/FieldType/DBObjectType.php b/src/ORM/FieldType/DBObjectType.php index f4ade846..9039c175 100644 --- a/src/ORM/FieldType/DBObjectType.php +++ b/src/ORM/FieldType/DBObjectType.php @@ -12,7 +12,7 @@ class DBObjectType extends DBField { public function __construct() { - Deprecation::withNoReplacement(function () { + Deprecation::withSuppressedWarning(function () { $message = 'Will be removed without equivalent functionality to replace it'; Deprecation::notice('5.3.0', $message, Deprecation::SCOPE_CLASS); }); diff --git a/src/TopPage/DataExtension.php b/src/TopPage/DataExtension.php index c52b78d2..341dbb63 100644 --- a/src/TopPage/DataExtension.php +++ b/src/TopPage/DataExtension.php @@ -56,7 +56,7 @@ class DataExtension extends BaseDataExtension public function __construct() { - Deprecation::withNoReplacement(function () { + Deprecation::withSuppressedWarning(function () { Deprecation::notice( '5.4.0', 'Will be replaced with DNADesign\Elemental\Extensions\TopPageElementExtension', diff --git a/src/TopPage/FluentExtension.php b/src/TopPage/FluentExtension.php index 35a26a3e..49406fe9 100644 --- a/src/TopPage/FluentExtension.php +++ b/src/TopPage/FluentExtension.php @@ -34,7 +34,7 @@ class FluentExtension extends DataExtension public function __construct() { - Deprecation::withNoReplacement(function () { + Deprecation::withSuppressedWarning(function () { Deprecation::notice( '5.4.0', 'Will be replaced with DNADesign\Elemental\Extensions\TopPageFluentElementExtension', diff --git a/src/TopPage/SiteTreeExtension.php b/src/TopPage/SiteTreeExtension.php index 4b41ab0d..7e07d6f1 100644 --- a/src/TopPage/SiteTreeExtension.php +++ b/src/TopPage/SiteTreeExtension.php @@ -37,7 +37,7 @@ class SiteTreeExtension extends BaseSiteTreeExtension public function __construct() { - Deprecation::withNoReplacement(function () { + Deprecation::withSuppressedWarning(function () { Deprecation::notice( '5.4.0', 'Will be replaced with DNADesign\Elemental\Extensions\TopPageSiteTreeExtension',