AbstractModel   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 5
dl 0
loc 15
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B setParameters() 0 9 5
1
<?php
2
3
namespace ByTIC\MFinante\Models;
4
5
use ByTIC\MFinante\Helper;
6
7
/**
8
 * Class AbstractModel
9
 * @package ByTIC\MFinante\Models
10
 */
11
abstract class AbstractModel
12
{
13
14
    /**
15
     * @param array $parameters
16
     */
17
    public function setParameters($parameters)
18
    {
19
        if (is_array($parameters)) {
20
            foreach ($parameters as $name => $value) {
21
                $method = 'set' . ucfirst(Helper::camelCase($name));
22
                if (method_exists($this, $method)) {
23
                    $this->$method($value);
24
                } elseif (property_exists($this, $name)) {
25
                    $this->{$name} = $value;
26
                }
27
            }
28
        }
29
    }
30
}
31