SiteTreeTest_ClassD   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A canEdit() 0 5 2
1
<?php
2
3
namespace SilverStripe\CMS\Tests\Model;
4
5
use SilverStripe\Dev\TestOnly;
6
use SilverStripe\CMS\Model\SiteTree;
7
8
class SiteTreeTest_ClassD extends SiteTree implements TestOnly
9
{
10
    private static $table_name = 'SiteTreeTest_ClassD';
0 ignored issues
show
introduced by
The private property $table_name is not used, and could be removed.
Loading history...
11
12
    // Only allows this class, no children classes
13
    private static $allowed_children = [
0 ignored issues
show
introduced by
The private property $allowed_children is not used, and could be removed.
Loading history...
14
        '*' . SiteTreeTest_ClassC::class,
15
    ];
16
17
    private static $extensions = [
0 ignored issues
show
introduced by
The private property $extensions is not used, and could be removed.
Loading history...
18
        SiteTreeTest_ExtensionA::class,
19
        SiteTreeTest_ExtensionB::class,
20
    ];
21
22
    public $canEditValue = null;
23
24
    public function canEdit($member = null)
25
    {
26
        return isset($this->canEditValue)
27
            ? $this->canEditValue
28
            : parent::canEdit($member);
29
    }
30
}
31