Passed
Push — master ( 1316c5...63993c )
by Matthew
05:18
created

CamelCase::fromCamelCase()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 8
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Dtc\GridBundle\Util;
4
5
class CamelCase
6
{
7
    /**
8
     * @param string $str
9
     *
10
     * @return string
11
     */
12
    public static function fromCamelCase($str)
13
    {
14
        $value = preg_replace_callback('/([A-Z])/', function ($str) {
15
            return ' '.$str[0];
16
        }, $str);
17
        $value = ucfirst($value);
18
19
        return trim($value);
20
    }
21
}
22