Skip to content

Commit

Permalink
ENH Don't use deprecated method
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Sep 18, 2024
1 parent 0f11fe0 commit b19510e
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion code/Controller/AssetAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion code/Controller/AssetAdminFieldsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion code/GraphQL/FileFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
Expand Down
2 changes: 1 addition & 1 deletion code/GraphQL/Notice.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions code/GraphQL/Resolvers/AssetAdminResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion code/GraphQL/Resolvers/FieldResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
Expand Down
2 changes: 1 addition & 1 deletion code/GraphQL/Resolvers/FileTypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
Expand Down
2 changes: 1 addition & 1 deletion code/GraphQL/Resolvers/FolderTypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
Expand Down
2 changes: 1 addition & 1 deletion code/GraphQL/Resolvers/PublicationResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
Expand Down
2 changes: 1 addition & 1 deletion code/GraphQL/Schema/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
Expand Down

0 comments on commit b19510e

Please sign in to comment.