AddressHelper::formatList()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 10
rs 10
cc 2
nc 2
nop 1
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
}