Completed
Push — master ( b90ec7...90c42f )
by Robbie
9s
created

ApproveHandler::updateComment()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace SilverStripe\Comments\Admin\CommentsGridFieldBulkAction;
4
5
use SilverStripe\Comments\Model\Comment;
6
7
/**
8
 * A {@link Handler} for bulk approving comments
9
 */
10
class ApproveHandler extends CommentHandler
11
{
12
    private static $url_segment = 'approve';
0 ignored issues
show
Comprehensibility introduced by Robbie Averill
Consider using a different property name as you override a private property of the parent class.
Loading history...
Unused Code introduced by Robbie Averill
The property $url_segment is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
13
14
    protected $buttonClasses = 'font-icon-tick';
15
16
    protected $label = 'Approve';
17
18
    /**
19
     * @param Comment $comment
20
     *
21
     * @return Comment
22
     */
23
    public function updateComment($comment)
24
    {
25
        $comment->markApproved();
26
        return $comment;
27
    }
28
}
29