SampleManageableObjectPageController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 0 4 1
A Form() 0 3 1
1
<?php
2
3
namespace Dynamic\ManageableDataObject\Test\Model;
4
5
use Dynamic\ManageableDataObject\Extensions\ManageableControllerExtension;
6
use Dynamic\ManageableDataObject\Form\ManageableDataObjectForm;
7
use SilverStripe\Dev\TestOnly;
8
use SilverStripe\View\Requirements;
9
10
/**
11
 * Class SampleManageableObjectPageController
12
 * @package Dynamic\ManageableDataObject\Test\Model
13
 *
14
 * @mixin ManageableControllerExtension
15
 */
16
class SampleManageableObjectPageController extends \PageController implements TestOnly
17
{
18
19
	/**
20
	 * @var array
21
	 */
22
	private static $allowed_actions = [
0 ignored issues
show
introduced by
The private property $allowed_actions is not used, and could be removed.
Loading history...
23
		'Form',
24
	];
25
26
	/**
27
	 * @var array
28
	 */
29
	private static $extensions = [
0 ignored issues
show
introduced by
The private property $extensions is not used, and could be removed.
Loading history...
30
		ManageableControllerExtension::class
31
	];
32
33
	/**
34
	 * @var string
35
	 */
36
	private static $managed_object = SampleManageableDataObject::class;
0 ignored issues
show
introduced by
The private property $managed_object is not used, and could be removed.
Loading history...
37
38
	/**
39
	 *
40
	 */
41
	public function init()
42
	{
43
		parent::init();
44
		Requirements::clear();
45
	}
46
47
	public function Form()
48
	{
49
		return ManageableDataObjectForm::create($this, 'Form', $this->config()->get('managed_object'));
50
	}
51
}
52