Completed
Push — 2.0 ( 34a54d...c1043f )
by Raphaël
11:03 queued 09:09
created

ComponentHelper   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A createFieldFromArray() 0 8 2
1
<?php
2
3
namespace Wabel\Zoho\CRM\Helpers;
4
5
6
use Wabel\Zoho\CRM\BeanComponents\Field;
7
8
class ComponentHelper
9
{
10
11
    /**
12
     * @param array $fieldConfigurations
13
     * @return Field
14
     */
15
    public static function createFieldFromArray(array $fieldConfigurations){
16
        $field = new Field();
17
        foreach ($fieldConfigurations as $keyFieldConfiguration => $valueFieldConfiguration){
18
            $method = 'set'.ucfirst($keyFieldConfiguration);
19
            $field->{$method}($valueFieldConfiguration);
20
        }
21
        return $field;
22
    }
23
}