PublishedStateDropdown   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getSource() 0 11 1
1
<?php
2
3
namespace Sunnnysideup\SearchOnVersionStatus\Forms;
4
5
use SilverStripe\Forms\DropdownField;
6
use SilverStripe\Versioned\Versioned;
0 ignored issues
show
Bug introduced by
The type SilverStripe\Versioned\Versioned was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
8
class PublishedStateDropdown extends DropdownField
9
{
10
    public function getSource()
11
    {
12
        $array = parent::getSource();
13
        $array['none'] = '-- any --';
14
        $array[Versioned::DRAFT] = 'Unpublished';
15
        $array[Versioned::LIVE] = 'Published';
16
        $array['MODIFIED'] = 'Published with modifications';
17
        $array['PUBLISHED_CLEAN'] = 'Published without modifications';
18
        $array['DRAFT_ERROR'] = 'Published but draft is missing (error!)';
19
20
        return $array;
21
    }
22
}
23