DataObjectSorterField::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 2
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