Completed
Pull Request — master (#3)
by Welling
02:30
created

helpers.php ➔ get_user_timezone()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
if (!function_exists('get_user_timezone')) {
4
    function get_user_timezone()
5
    {
6
        return 'UTC';
7
    }
8
}
9
10
if (!function_exists('to_name_value')) {
11
    function to_name_value($array, $keys = null)
12
    {
13
        $data = [];
14
        foreach ($array as $name => $value) {
15
            $row = ['name' => $name, 'value' => $value];
16
            if (isset($keys)) $row = array_merge($row, $keys);
17
            array_push($data, $row);
18
        }
19
20
        return $data;
21
    }
22
}