Completed
Push — master ( 0ebf95...33622c )
by Damian
12s
created

CMSPageAddControllerExtension   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 5
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 5
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A updatePageOptions() 0 3 1
1
<?php
2
3
namespace SilverStripe\Subsites\Extensions;
4
5
use SilverStripe\Core\Extension;
6
use SilverStripe\Forms\FieldList;
7
use SilverStripe\Forms\HiddenField;
8
use SilverStripe\Subsites\State\SubsiteState;
9
10
class CMSPageAddControllerExtension extends Extension
11
{
12
    public function updatePageOptions(FieldList $fields)
13
    {
14
        $fields->push(HiddenField::create('SubsiteID', 'SubsiteID', SubsiteState::singleton()->getSubsiteId()));
0 ignored issues
show
Bug introduced by
'SubsiteID' of type string is incompatible with the type array expected by parameter $args of SilverStripe\View\ViewableData::create(). ( Ignorable by Annotation )

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

14
        $fields->push(HiddenField::create(/** @scrutinizer ignore-type */ 'SubsiteID', 'SubsiteID', SubsiteState::singleton()->getSubsiteId()));
Loading history...
15
    }
16
}
17