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

SpamHandler   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 19
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A updateComment() 0 5 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 marking comments as spam
9
 */
10
class SpamHandler extends CommentHandler
11
{
12
    private static $url_segment = 'spam';
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
Unused Code introduced by
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-cross-mark';
15
16
    protected $label = 'Spam';
17
18
    /**
19
     * @param Comment $comment
20
     *
21
     * @return Comment
22
     */
23
    public function updateComment($comment)
24
    {
25
        $comment->markSpam();
26
        return $comment;
27
    }
28
}
29