Skip to content

Commit

Permalink
ENH Don't use deprecated method
Browse files Browse the repository at this point in the history
GuySartorelli committed Sep 17, 2024
1 parent 76d98cf commit 72bbe5c
Showing 13 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/GraphQL/Operations/AbstractPublishOperationCreator.php
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@ abstract class AbstractPublishOperationCreator implements OperationCreator

public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::withSuppressedWarning(function () {
Deprecation::notice('2.3.0', 'Will be moved to the silverstripe/graphql module', Deprecation::SCOPE_CLASS);
});
}
2 changes: 1 addition & 1 deletion src/GraphQL/Operations/CopyToStageCreator.php
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ class CopyToStageCreator implements OperationCreator

public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::withSuppressedWarning(function () {
Deprecation::notice('2.3.0', 'Will be moved to the silverstripe/graphql module', Deprecation::SCOPE_CLASS);
});
}
2 changes: 1 addition & 1 deletion src/GraphQL/Operations/PublishCreator.php
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ class PublishCreator extends AbstractPublishOperationCreator
{
public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::withSuppressedWarning(function () {
Deprecation::notice('2.3.0', 'Will be moved to the silverstripe/graphql module', Deprecation::SCOPE_CLASS);
});
}
2 changes: 1 addition & 1 deletion src/GraphQL/Operations/RollbackCreator.php
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ class RollbackCreator implements OperationCreator

public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::withSuppressedWarning(function () {
Deprecation::notice('2.3.0', 'Will be moved to the silverstripe/graphql module', Deprecation::SCOPE_CLASS);
});
}
2 changes: 1 addition & 1 deletion src/GraphQL/Operations/UnpublishCreator.php
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ class UnpublishCreator extends AbstractPublishOperationCreator
{
public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::withSuppressedWarning(function () {
Deprecation::notice('2.3.0', 'Will be moved to the silverstripe/graphql module', Deprecation::SCOPE_CLASS);
});
}
2 changes: 1 addition & 1 deletion src/GraphQL/Plugins/UnpublishOnDelete.php
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ class UnpublishOnDelete implements ModelMutationPlugin

public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::withSuppressedWarning(function () {
Deprecation::notice('2.3.0', 'Will be moved to the silverstripe/graphql module', Deprecation::SCOPE_CLASS);
});
}
2 changes: 1 addition & 1 deletion src/GraphQL/Plugins/VersionedDataObject.php
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ class VersionedDataObject implements ModelTypePlugin, SchemaUpdater

public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::withSuppressedWarning(function () {
Deprecation::notice('2.3.0', 'Will be moved to the silverstripe/graphql module', Deprecation::SCOPE_CLASS);
});
}
2 changes: 1 addition & 1 deletion src/GraphQL/Plugins/VersionedRead.php
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ class VersionedRead implements ModelQueryPlugin

public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::withSuppressedWarning(function () {
Deprecation::notice('2.3.0', 'Will be moved to the silverstripe/graphql module', Deprecation::SCOPE_CLASS);
});
}
2 changes: 1 addition & 1 deletion src/GraphQL/Resolvers/VersionFilters.php
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ class VersionFilters
{
public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::withSuppressedWarning(function () {
Deprecation::notice('2.3.0', 'Will be moved to the silverstripe/graphql module', Deprecation::SCOPE_CLASS);
});
}
2 changes: 1 addition & 1 deletion src/GraphQL/Resolvers/VersionedResolver.php
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ class VersionedResolver

public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::withSuppressedWarning(function () {
Deprecation::notice('2.3.0', 'Will be moved to the silverstripe/graphql module', Deprecation::SCOPE_CLASS);
});
}
4 changes: 2 additions & 2 deletions src/GridFieldArchiveAction.php
Original file line number Diff line number Diff line change
@@ -177,7 +177,7 @@ public function handleAction(GridField $gridField, $actionName, $arguments, $dat
return;
}

$canArchive = Deprecation::withNoReplacement(fn() => $item->canArchive());
$canArchive = Deprecation::withSuppressedWarning(fn() => $item->canArchive());
if (!$canArchive) {
throw new ValidationException(
_t(__CLASS__ . '.ArchivePermissionsFailure', "No archive permissions")
@@ -201,7 +201,7 @@ public function getArchiveAction($gridField, $record)
if (!$record->hasMethod('canArchive')) {
return null;
}
$canArchive = Deprecation::withNoReplacement(fn() => $record->canArchive());
$canArchive = Deprecation::withSuppressedWarning(fn() => $record->canArchive());
if (!$canArchive) {
return null;
}
4 changes: 2 additions & 2 deletions src/Versioned.php
Original file line number Diff line number Diff line change
@@ -1509,7 +1509,7 @@ public function canArchive($member = null)

// Standard mechanism for accepting permission changes from extensions
$owner = $this->owner;
$extended = Deprecation::withNoReplacement(fn() => $owner->extendedCan('canArchive', $member));
$extended = Deprecation::withSuppressedWarning(fn() => $owner->extendedCan('canArchive', $member));
if ($extended !== null) {
return $extended;
}
@@ -2027,7 +2027,7 @@ public function stagesDifferRecursive(): bool
public function Versions($filter = "", $sort = "", $limit = "", $join = "", $having = "")
{
if ($having) {
Deprecation::withNoReplacement(function () {
Deprecation::withSuppressedWarning(function () {
$message = 'The $having parameter does nothing and will be removed without equivalent'
. ' functionality to replace it';
Deprecation::notice('2.2.0', $message);
4 changes: 2 additions & 2 deletions src/VersionedGridFieldItemRequest.php
Original file line number Diff line number Diff line change
@@ -119,7 +119,7 @@ public function doArchive($data, $form)
{
/** @var Versioned|DataObject $record */
$record = $this->getRecord();
$canArchive = Deprecation::withNoReplacement(fn() => $record->canArchive());
$canArchive = Deprecation::withSuppressedWarning(fn() => $record->canArchive());
if (!$canArchive) {
return $this->httpError(403);
}
@@ -295,7 +295,7 @@ protected function addVersionedButtons(DataObject $record, FieldList $actions)
$canPublish = $record->canPublish();
$canUnpublish = $record->canUnpublish();
$canEdit = $record->canEdit();
$canArchive = Deprecation::withNoReplacement(fn() => $record->canArchive());
$canArchive = Deprecation::withSuppressedWarning(fn() => $record->canArchive());

// "save", supports an alternate state that is still clickable, but notifies the user that the action is not needed.
$noChangesClasses = 'btn-outline-primary font-icon-tick';

0 comments on commit 72bbe5c

Please sign in to comment.