Data   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __set() 0 5 1
A __get() 0 6 2
1
<?php
2
3
namespace App\Model;
4
5
/**
6
 * Class Data
7
 */
8
final class Data
9
{
10
    /**
11
     * Get property
12
     *
13
     * @param string $property
14
     * @return mixed
15
     */
16
    public function __get($property)
17
    {
18
        if (property_exists($this, $property)) {
19
            return $this->$property;
20
        } else {
21
            return null;
22
        }
23
    }
24
25
    /**
26
     * Set property
27
     *
28
     * @param string $property
29
     * @param mixed $value
30
     * @return object
31
     */
32
    public function __set($property, $value)
33
    {
34
        $this->$property = $value;
35
36
        return $this;
37
    }
38
}
39