GridFieldConfigBlogPost   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
1
<?php
2
3
namespace SilverStripe\Blog\Forms\GridField;
4
5
use SilverStripe\Core\Injector\Injector;
6
use SilverStripe\Lumberjack\Forms\GridFieldConfig_Lumberjack;
7
use SilverStripe\Lumberjack\Forms\GridFieldSiteTreeState;
8
9
/**
10
 * GridField config necessary for managing a SiteTree object.
11
 *
12
 */
13
class GridFieldConfigBlogPost extends GridFieldConfig_Lumberjack
14
{
15
    /**
16
     * @param null|int $itemsPerPage
17
     */
18
    public function __construct($itemsPerPage = null)
19
    {
20
        parent::__construct($itemsPerPage);
21
22
        $this->removeComponentsByType(GridFieldSiteTreeState::class);
23
        $this->addComponent(Injector::inst()->create(GridFieldBlogPostState::class));
24
    }
25
}
26