DataObjectSorterField   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 4
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
1
<?php
2
/**
3
 * @description: allows you to sort dataobjects
4
 * @author: Nicolaas [at] sunnysideup.co.nz
5
 * @package: dataobjectsorter
6
 */
7
class DataObjectSorterField extends LiteralField
8
{
9
10
    /**
11
     * @var string $content
12
     */
13
    protected $content;
14
15
    public function __construct($name, $ClassName)
16
    {
17
        DataObjectSorterRequirements::popup_link_requirements();
18
        $objects = $ClassName::get();
19
        $arrayList = new ArrayList();
20
        $dos->Children = $objects;
0 ignored issues
show
Bug introduced by
The variable $dos does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
21
        $content = $this->customise($arrayList)->renderWith("DataObjectSorterField");
22
        parent::__construct($name, $content);
23
    }
24
}
25