AddressHelper   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 7
c 1
b 0
f 0
dl 0
loc 19
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A formatList() 0 10 2
1
<?php
2
namespace tonisormisson\addressform;
3
4
5
/**
6
 * Class AddressHelper
7
 * @package tonisormisson\addressform
8
 * @author Tõnis Ormisson <[email protected]>
9
 */
10
class AddressHelper
11
{
12
13
14
    /**
15
     * make the simple array list to DepDrop eatable list with id & name
16
     * @param $list
17
     * @return array
18
     */
19
    public function formatList($list)
20
    {
21
        $out = [];
22
        foreach ($list as  $key => $value) {
23
            $out[] = [
24
                'id' => $key,
25
                'name' => $value['name'],
26
            ];
27
        }
28
        return $out;
29
    }
30
31
}