From 2ae99d06349b1843af1c568c8b0c760600b8c3a2 Mon Sep 17 00:00:00 2001
From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com>
Date: Thu, 19 Sep 2024 14:07:11 +1200
Subject: [PATCH 1/2] ENH Don't use deprecated method (#1255)
---
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..e79d2b84 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::withSuppressedNotice(
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..dac9837b 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::withSuppressedNotice(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..f26fa9f7 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::withSuppressedNotice(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::withSuppressedNotice(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::withSuppressedNotice(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..b4bc7929 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::withSuppressedNotice(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..d98fe61e 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::withSuppressedNotice(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..5417896e 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::withSuppressedNotice(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..44dc529e 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::withSuppressedNotice(function () {
Deprecation::notice(
'5.4.0',
'Will be replaced with DNADesign\Elemental\Extensions\TopPageSiteTreeExtension',
From 69cc127c2b6c47062515a4146da120417096252f Mon Sep 17 00:00:00 2001
From: Steve Boyd
Date: Mon, 23 Sep 2024 15:14:24 +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 6d4857ce..8c9ce7c5 100644
--- a/composer.json
+++ b/composer.json
@@ -19,7 +19,7 @@
"prefer-stable": true,
"require": {
"php": "^8.1",
- "silverstripe/framework": "^5.2",
+ "silverstripe/framework": "^5.4",
"silverstripe/cms": "^5",
"silverstripe/admin": "^2.0.1",
"silverstripe/versioned": "^2",