Inflector   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
c 3
b 0
f 0
dl 0
loc 16
ccs 6
cts 6
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A camelize() 0 8 2
1
<?php
2
3
namespace Guillermoandrae\DynamoDb\Helper;
4
5
/**
6
 * Inflector class.
7
 *
8
 * @author Guillermo A. Fisher <[email protected]>
9
 */
10
final class Inflector
11
{
12
    /**
13
     * Returns a camel-cased string.
14
     *
15
     * @param string $input The input string.
16
     * @return string The camel-cased string.
17
     */
18 37
    public static function camelize(string $input): string
19
    {
20 37
        $output = '';
21 37
        $segments = explode('-', $input);
22 37
        foreach ($segments as $segment) {
23 37
            $output .= ucfirst(strtolower($segment));
24
        }
25 37
        return $output;
26
    }
27
}
28