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

CamelCase   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 6
c 0
b 0
f 0
dl 0
loc 15
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromCamelCase() 0 8 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