Completed
Push — master ( 8482f5...6f4e0b )
by max
02:05
created

Version   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 38
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A exchangeArray() 0 6 3
A getId() 0 4 1
A getVersion() 0 4 1
1
<?php
2
3
namespace T4web\Migrations\Version;
4
5
class Version
6
{
7
8
    const TABLE_NAME = 'migration_version';
9
10
    /**
11
     * @var int
12
     */
13
    protected $id;
14
15
    /**
16
     * @var int
17
     */
18
    protected $version;
19
20
    public function exchangeArray($data)
21
    {
22
        foreach (array_keys(get_object_vars($this)) as $property) {
23
            $this->{$property} = (isset($data[$property])) ? $data[$property] : null;
24
        }
25
    }
26
27
    /**
28
     * @return int
29
     */
30
    public function getId()
31
    {
32
        return $this->id;
33
    }
34
35
    /**
36
     * @return int
37
     */
38
    public function getVersion()
39
    {
40
        return $this->version;
41
    }
42
}
43