Completed
Push — master ( 4e2d22...187618 )
by Will
14:40
created

CommentsGridField::newRow()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 16
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 9
nc 4
nop 5
1
<?php
2
3
namespace SilverStripe\Comments\Admin;
4
5
use SilverStripe\Forms\FormField;
6
use SilverStripe\Forms\GridField\GridField;
7
8
class CommentsGridField extends GridField
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13
    protected function newRow($total, $index, $record, $attributes, $content)
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
14
    {
15
        if (!isset($attributes['class'])) {
16
            $attributes['class'] = '';
17
        }
18
19
        if ($record->IsSpam) {
20
            $attributes['class'] .= ' spam';
21
        }
22
23
        return FormField::create_tag(
0 ignored issues
show
Bug introduced by
The method create_tag() does not exist on SilverStripe\Forms\FormField. Did you maybe mean create()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
24
            'tr',
25
            $attributes,
26
            $content
27
        );
28
    }
29
}
30