Passed
Pull Request — master (#31)
by Robbie
02:08
created

CKANRegistryPage::getSettingsFields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 9
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace SilverStripe\CKANRegistry\Page;
4
5
use Page;
0 ignored issues
show
Bug introduced by
The type Page 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...
6
use SilverStripe\Forms\TextField;
7
8
/**
9
 * A CKANRegistryPage will render a chosen CKAN data set on the frontend, provide the user with configurable filters
10
 * and display a set of CMS configured columns.
11
 */
12
class CKANRegistryPage extends Page
13
{
14
    private static $table_name = 'CKANRegistryPage';
0 ignored issues
show
introduced by
The private property $table_name is not used, and could be removed.
Loading history...
15
16
    private static $db = [
0 ignored issues
show
introduced by
The private property $db is not used, and could be removed.
Loading history...
17
        'ItemsPerPage' => 'Int',
18
    ];
19
20
    private static $defaults = [
0 ignored issues
show
introduced by
The private property $defaults is not used, and could be removed.
Loading history...
21
        'ItemsPerPage' => 20,
22
    ];
23
24
    private static $singular_name = 'CKAN Registry Page';
0 ignored issues
show
introduced by
The private property $singular_name is not used, and could be removed.
Loading history...
25
26
    private static $plural_name = 'CKAN Registry Pages';
0 ignored issues
show
introduced by
The private property $plural_name is not used, and could be removed.
Loading history...
27
28
    public function getSettingsFields()
29
    {
30
        $fields = parent::getSettingsFields();
31
32
        $fields->addFieldsToTab('Root.Settings', [
33
            TextField::create('ItemsPerPage', _t(__CLASS__ . '.ItemsPerPage', 'Items per page')),
34
        ]);
35
36
        return $fields;
37
    }
38
}
39