Completed
Push — master ( 6344d3...86aff3 )
by Tyler
02:06
created

Model   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 26
c 0
b 0
f 0
ccs 14
cts 14
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 3
A toArray() 0 8 2
1
<?php
2
3
namespace Zenapply\PeopleMatter;
4
5
class Model
6
{
7
    protected $properties = [
8
        
9
    ];
10
    
11 9
    public function __construct($options)
12
    {
13 9
        foreach ($this->properties as $key) {
14 3
            $this->{$key} = "";
15 9
        }
16
17 9
        foreach ($options as $key => $value) {
18 9
            $this->{$key} = $value;
19 9
        }
20 9
    }
21
22 3
    public function toArray()
23
    {
24 3
        $arr = [];
25 3
        foreach ($this->properties as $key) {
26 3
            $arr[$key] = $this->{$key};
27 3
        }
28 3
        return $arr;
29
    }
30
}
31