Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH Don't use deprecated method #476

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/GraphQL/Operations/AbstractPublishOperationCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ abstract class AbstractPublishOperationCreator implements OperationCreator

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 src/GraphQL/Operations/CopyToStageCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class CopyToStageCreator implements OperationCreator

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 src/GraphQL/Operations/PublishCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class PublishCreator extends AbstractPublishOperationCreator
{
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 src/GraphQL/Operations/RollbackCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class RollbackCreator implements OperationCreator

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 src/GraphQL/Operations/UnpublishCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class UnpublishCreator extends AbstractPublishOperationCreator
{
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 src/GraphQL/Plugins/UnpublishOnDelete.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class UnpublishOnDelete implements ModelMutationPlugin

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 src/GraphQL/Plugins/VersionedDataObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class VersionedDataObject implements ModelTypePlugin, 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
2 changes: 1 addition & 1 deletion src/GraphQL/Plugins/VersionedRead.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class VersionedRead implements ModelQueryPlugin

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 src/GraphQL/Resolvers/VersionFilters.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class VersionFilters
{
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 src/GraphQL/Resolvers/VersionedResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class VersionedResolver

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
4 changes: 2 additions & 2 deletions src/GridFieldArchiveAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public function handleAction(GridField $gridField, $actionName, $arguments, $dat
return;
}

$canArchive = Deprecation::withNoReplacement(fn() => $item->canArchive());
$canArchive = Deprecation::withSuppressedNotice(fn() => $item->canArchive());
if (!$canArchive) {
throw new ValidationException(
_t(__CLASS__ . '.ArchivePermissionsFailure', "No archive permissions")
Expand All @@ -201,7 +201,7 @@ public function getArchiveAction($gridField, $record)
if (!$record->hasMethod('canArchive')) {
return null;
}
$canArchive = Deprecation::withNoReplacement(fn() => $record->canArchive());
$canArchive = Deprecation::withSuppressedNotice(fn() => $record->canArchive());
if (!$canArchive) {
return null;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Versioned.php
Original file line number Diff line number Diff line change
Expand Up @@ -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::withSuppressedNotice(fn() => $owner->extendedCan('canArchive', $member));
if ($extended !== null) {
return $extended;
}
Expand Down Expand Up @@ -2027,7 +2027,7 @@ public function stagesDifferRecursive(): bool
public function Versions($filter = "", $sort = "", $limit = "", $join = "", $having = "")
{
if ($having) {
Deprecation::withNoReplacement(function () {
Deprecation::withSuppressedNotice(function () {
$message = 'The $having parameter does nothing and will be removed without equivalent'
. ' functionality to replace it';
Deprecation::notice('2.2.0', $message);
Expand Down
4 changes: 2 additions & 2 deletions src/VersionedGridFieldItemRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function doArchive($data, $form)
{
/** @var Versioned|DataObject $record */
$record = $this->getRecord();
$canArchive = Deprecation::withNoReplacement(fn() => $record->canArchive());
$canArchive = Deprecation::withSuppressedNotice(fn() => $record->canArchive());
if (!$canArchive) {
return $this->httpError(403);
}
Expand Down Expand Up @@ -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::withSuppressedNotice(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';
Expand Down
Loading