Completed
Push — 4 ( cb3786...fc8709 )
by Steve
32s queued 24s
created

PolymorphicPeopleGroup   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCMSFields() 0 13 1
1
<?php
2
3
namespace SilverStripe\Forms\Tests\GridField\GridFieldDetailFormTest;
4
5
use SilverStripe\Dev\TestOnly;
6
use SilverStripe\Forms\GridField\GridField;
7
use SilverStripe\Forms\GridField\GridFieldConfig_RelationEditor;
8
use SilverStripe\ORM\DataObject;
9
10
class PolymorphicPeopleGroup extends DataObject implements TestOnly
11
{
12
    private static $table_name = 'GridFieldDetailFormTest_PolymorphicPeopleGroup';
0 ignored issues
show
introduced by
The private property $table_name is not used, and could be removed.
Loading history...
13
14
    private static $db = [
0 ignored issues
show
introduced by
The private property $db is not used, and could be removed.
Loading history...
15
        'Name' => 'Varchar'
16
    ];
17
18
    private static $has_many = [
0 ignored issues
show
introduced by
The private property $has_many is not used, and could be removed.
Loading history...
19
        'People' => Person::class
20
    ];
21
22
    private static $default_sort = '"Name"';
0 ignored issues
show
introduced by
The private property $default_sort is not used, and could be removed.
Loading history...
23
24
    public function getCMSFields()
25
    {
26
        $fields = parent::getCMSFields();
27
        $fields->replaceField(
28
            'People',
29
            GridField::create(
30
                'People',
31
                'People',
32
                $this->People(),
0 ignored issues
show
Bug introduced by
The method People() does not exist on SilverStripe\Forms\Tests...\PolymorphicPeopleGroup. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

32
                $this->/** @scrutinizer ignore-call */ 
33
                       People(),
Loading history...
33
                GridFieldConfig_RelationEditor::create()
34
            )
35
        );
36
        return $fields;
37
    }
38
}
39