ApproveHandler   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 17
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A updateComment() 0 4 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
introduced by
The private property $url_segment is not used, and could 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