Name   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 92.31%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 20
ccs 12
cts 13
cp 0.9231
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A camelize() 0 18 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace drupol\ComposerPackages\Utils;
6
7
final class Name
8
{
9 5
    public static function camelize(string $str): string
10
    {
11 5
        $str = preg_replace(
12 5
            '/[^a-z0-9]+/i',
13 5
            ' ',
14 5
            $str
15
        );
16
17 5
        if (null === $str) {
18
            return '';
19
        }
20
21 5
        return lcfirst(
22 5
            str_replace(
23 5
                ' ',
24 5
                '',
25 5
                ucwords(
26 5
                    $str
27
                )
28
            )
29
        );
30
    }
31
}
32