Completed
Push — master ( 427685...52c844 )
by Alex Ribeiro de
24s queued 11s
created

_strToUpper()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 1
cts 1
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
if (!function_exists("toCamelCase")) {
4
    function toCamelCase($str)
5
    {
6 18
        $str = ctype_upper($str) ? strtolower($str) : $str;
7 18
        $str =  preg_replace_callback('/_([a-z])/', "_strToUpper", $str);
8 18
        return lcfirst(str_replace("_", "", $str));
9
    }
10
    function _strToUpper($letter)
11
    {
12 18
         return strtoupper($letter[1]);
13
    }
14
}
15
16
if (! function_exists('is_object_array')) {
17
    /**
18
     * @param $value
19
     * @return bool
20
     */
21
    function is_object_array($value)
22
    {
23 18
        return count(array_filter(array_keys($value), 'is_string')) > 0;
24
    }
25
}
26