DataObject   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 24
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __get() 0 4 1
1
<?php
2
namespace DriveNow;
3
4
/**
5
 * Class DataObject
6
 * @package DriveNow
7
 */
8
class DataObject
9
{
10
    private $data;
11
12
    /**
13
     * Constructor, saves data on object
14
     * @param array $data
15
     */
16
    public function __construct(array $data)
17
    {
18
        $this->data = $data;
19
    }
20
21
    /**
22
     * Custom getter
23
     * @param $key
24
     * @return mixed
25
     */
26
    public function __get($key)
27
    {
28
        return $this->data[$key];
29
    }
30
31
}