API Update deprecations

This commit is contained in:
Steve Boyd 2022-11-16 12:13:50 +13:00
parent a88bd6fff6
commit c3ef4d6efc
3 changed files with 20 additions and 2 deletions

View File

@ -2,6 +2,7 @@
namespace SilverStripe\Comments\Admin;
use SilverStripe\Dev\Deprecation;
use SilverStripe\Comments\Model\Comment;
use SilverStripe\Control\Controller;
use SilverStripe\Forms\GridField\GridField;
@ -10,13 +11,22 @@ use SilverStripe\Forms\GridField\GridField_ColumnProvider;
use SilverStripe\Forms\GridField\GridField_FormAction;
/**
* @deprecated 3.2.0 {@see CommentsGridFieldApproveAction} and {@see CommentsGridFieldSpamAction} instead
* @deprecated 3.2.0 Use CommentsGridFieldApproveAction CommentsGridFieldSpamAction instead
*/
class CommentsGridFieldAction implements GridField_ColumnProvider, GridField_ActionProvider
{
/**
* {@inheritdoc}
*/
public function __construct()
{
Deprecation::notice(
'3.2.0',
'Use CommentsGridFieldApproveAction CommentsGridFieldSpamAction instead',
Deprecation::SCOPE_CLASS
);
}
public function augmentColumns($gridField, &$columns)
{
if (!in_array('Actions', $columns ?? [])) {

View File

@ -2,6 +2,7 @@
namespace SilverStripe\Comments\Admin\CommentsGridFieldBulkAction;
use SilverStripe\Dev\Deprecation;
use Colymba\BulkManager\BulkAction\Handler as GridFieldBulkActionHandler;
use SilverStripe\Core\Convert;
use SilverStripe\Control\HTTPRequest;
@ -10,7 +11,7 @@ use SilverStripe\Control\HTTPResponse;
/**
* A {@link GridFieldBulkActionHandler} for bulk marking comments as spam
*
* @deprecated 3.1..4.0 Abstract handlers are removed, please use concrete Spam or Approve handlers
* @deprecated 3.1.0 Use concrete Spam or Approve handlers instead
*/
class Handler extends GridFieldBulkActionHandler
{
@ -28,6 +29,11 @@ class Handler extends GridFieldBulkActionHandler
* @param HTTPRequest $request
* @return HTTPResponse
*/
public function __construct()
{
Deprecation::notice('3.1.0', 'Use concrete Spam or Approve handlers instead', Deprecation::SCOPE_CLASS);
}
public function spam(HTTPRequest $request)
{
$ids = array();

View File

@ -2,6 +2,7 @@
namespace SilverStripe\Comments\Model;
use SilverStripe\Dev\Deprecation;
use HTMLPurifier;
use HTMLPurifier_Config;
use SilverStripe\Comments\Controllers\CommentingController;
@ -264,6 +265,7 @@ class Comment extends DataObject
*/
public function getParent()
{
Deprecation::notice('4.0.0', 'Use $this->Parent() instead');
return $this->BaseClass && $this->ParentID
? DataObject::get_by_id($this->BaseClass, $this->ParentID, true)
: null;