These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
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
|
|||
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( |
||
24 | 'tr', |
||
25 | $attributes, |
||
26 | $content |
||
27 | ); |
||
28 | } |
||
29 | } |
||
30 |
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.