Passed
Push — master ( 03087a...f49b8e )
by Gabriel
01:58
created

InflectionClassifyTrait   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A doClassify() 0 7 1
1
<?php
2
3
namespace Nip\Inflector\Traits;
4
5
/**
6
 * Trait InflectionClassifyTrait
7
 * @package Nip\Inflector\Traits
8
 *
9
 * @method classify($string)
10
 */
11
trait InflectionClassifyTrait
12
{
13
14
    /**
15
     * Converts lowercase string to underscored camelize class format
16
     *
17
     * @param string $string
18
     * @return string
19
     */
20 6
    protected function doClassify($string)
21
    {
22 6
        $parts = explode("-", $string);
23 6
        $parts = array_map([$this, "camelize"], $parts);
24
25 6
        return implode("_", $parts);
26
    }
27
}
28