Passed
Push — master ( dcbf99...d299e4 )
by Romain
29s
created

UtilityTrait   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 15
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A camelize() 0 4 1
1
<?php
2
namespace Kerox\Messenger\Helper;
3
4
trait UtilityTrait
5
{
6
7
    /**
8
     * Returns the input lower_case_delimited_string as a CamelCasedString.
9
     *
10
     * @param string $string String to be camelize
11
     * @param string $delimiter The delimiter in the input string
12
     * @return string
13
     */
14 11
    public static function camelize(string $string, string $delimiter = '_'): string
15
    {
16 11
        return implode('', array_map('ucfirst', array_map('strtolower', explode($delimiter, $string))));
17
    }
18
}
19