Skip to content

Commit

Permalink
ENH Don't use deprecated method (silverstripe#1255)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli authored Sep 19, 2024
1 parent b923eae commit 2ae99d0
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Extensions/ElementalLeftAndMainExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/GraphQL/Resolvers/Resolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
6 changes: 3 additions & 3 deletions src/Models/BaseElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -1166,7 +1166,7 @@ public function getDescription()
*/
public function getTypeNice()
{
$description = Deprecation::withNoReplacement(fn () => $this->getDescription());
$description = Deprecation::withSuppressedNotice(fn () => $this->getDescription());
$desc = ($description) ? ' <span class="element__note"> &mdash; ' . $description . '</span>' : '';

return DBField::create_field(
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/ORM/FieldType/DBObjectType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion src/TopPage/DataExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/TopPage/FluentExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/TopPage/SiteTreeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 2ae99d0

Please sign in to comment.