Passed
Push — search-or-choose-page ( 2890bb...a9ad34 )
by
unknown
08:26
created

TestObject   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getField() 0 3 2
A __construct() 0 3 1
A hasField() 0 3 1
A getSomething() 0 3 1
1
<?php
2
3
namespace SilverStripe\Dev\Tests\ViewableDataContainsTest;
4
5
use SilverStripe\Dev\TestOnly;
6
use SilverStripe\View\ViewableData;
7
8
class TestObject extends ViewableData implements TestOnly
9
{
10
    protected $data = null;
11
12
    public function __construct($data)
13
    {
14
        $this->data = $data;
15
    }
16
17
    public function hasField($name)
18
    {
19
        return isset($this->data[$name]);
20
    }
21
22
    public function getField($name)
23
    {
24
        return isset($this->data[$name]) ?: null;
25
    }
26
27
    public function getSomething()
28
    {
29
        return 'something';
30
    }
31
}
32