AccessorsTraitBench   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 0 4 1
A bench_GetProperty_DynamicProperty() 0 3 1
A bench_GetterMethod_DynamicProperty() 0 3 1
A bench_GetProperty_PrivateProperty() 0 3 1
A bench_GetterMethod_PrivateProperty() 0 3 1
1
<?php
2
3
use ByTIC\DataObjects\Tests\Fixtures\Dto\ObjectWithGetSet;
4
5
/**
6
 * Class AccessorsTraitBench
7
 * @Iterations(5)
8
 * @Revs(100)
9
 * @BeforeMethods({"init"})
10
 */
11
class AccessorsTraitBench
12
{
13
    protected $objectWithData;
14
    protected $object;
15
16
    public function bench_GetProperty_DynamicProperty()
17
    {
18
        $this->object->name;
19
    }
20
21
    public function bench_GetterMethod_DynamicProperty()
22
    {
23
        $this->object->getName();
24
    }
25
26
    public function bench_GetProperty_PrivateProperty()
27
    {
28
        $this->object->title;
29
    }
30
31
    public function bench_GetterMethod_PrivateProperty()
32
    {
33
        $this->object->getTitle();
34
    }
35
36
    public function init()
37
    {
38
        $this->objectWithData = new ObjectWithGetSet(['name' => 'test']);
39
        $this->object = new ObjectWithGetSet();
40
    }
41
}
42