Inflector   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 12
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A pascalize() 0 4 1
A camelize() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Linio\Component\Util;
6
7
class Inflector
0 ignored issues
show
Coding Style introduced by
Inflector does not seem to conform to the naming convention (Utils?$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
8
{
9
    public static function pascalize(string $string, string $separator = '_-'): string
10
    {
11
        return ucfirst(str_replace(' ', '', ucwords(strtr($string, $separator, '  '))));
12
    }
13
14
    public static function camelize(string $string, string $separator = '_-'): string
15
    {
16
        return lcfirst(self::pascalize($string, $separator));
17
    }
18
}
19