Completed
Push — master ( ce1bfb...dabc7b )
by Tom
02:08
created

ByValueDifferentiatorEntity   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 0
dl 0
loc 42
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setId() 0 4 1
A getId() 0 4 1
A setField() 0 9 2
A getField() 0 9 2
1
<?php
2
3
namespace DoctrineModuleTest\Stdlib\Hydrator\Asset;
4
5
class ByValueDifferentiatorEntity
6
{
7
    /**
8
     * @var int
9
     */
10
    protected $id;
11
12
    /**
13
     * @var string
14
     */
15
    protected $field;
16
17
    public function setId($id)
18
    {
19
        $this->id = $id;
20
    }
21
22
    public function getId()
23
    {
24
        return $this->id;
25
    }
26
27
    public function setField($field, $modifyValue = true)
28
    {
29
        // Modify the value to illustrate the difference between by value and by reference
30
        if ($modifyValue) {
31
            $this->field = "From setter: $field";
32
        } else {
33
            $this->field = $field;
34
        }
35
    }
36
37
    public function getField($modifyValue = true)
38
    {
39
        // Modify the value to illustrate the difference between by value and by reference
40
        if ($modifyValue) {
41
            return "From getter: $this->field";
42
        } else {
43
            return $this->field;
44
        }
45
    }
46
}
47