Test Failed
Push — master ( 892598...558941 )
by Antonio Carlos
11:17
created

ImportProperties   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 18
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A importProperties() 0 10 2
1
<?php
2
3
namespace PragmaRX\Health\Support\Traits;
4
5
trait ImportProperties
6
{
7
    /**
8
     * Import all collection items to object properties.
9
     *
10
     * @param $data
11
     */
12 3
    public function importProperties($data)
13
    {
14
        $data->each(function ($value, $key) {
15 3
            $key = camel_case($key);
16
17 3
            if (!property_exists($this, $key)) {
18 3
                $this->$key = $value;
19
            }
20 3
        });
21 3
    }
22
}
23