Completed
Push — master ( 33b846...7721ee )
by Guillermo A.
09:03
created

Inflector   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 8
c 1
b 0
f 0
dl 0
loc 13
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A camelize() 0 11 3
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
    public static function camelize(string $input): string
13
    {
14
        $output = $input;
15
        if (strstr($input, '-')) {
16
            $output = '';
17
            $segments = explode('-', $input);
18
            foreach ($segments as $segment) {
19
                $output .= strtoupper($segment);
20
            }
21
        }
22
        return $output;
23
    }
24
}
25