Completed
Push — master ( 4bb4eb...402013 )
by Arthur
03:35
created

StringHelper::camelize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Arthem\GraphQLMapper\Utils;
4
5
abstract class StringHelper
6
{
7
    /**
8
     * Camelizes a string.
9
     *
10
     * @param string $id A string to camelize
11
     * @return string The camelized string
12
     */
13
    public static function camelize($id)
14
    {
15
        return strtr(ucwords(strtr($id, ['_' => ' ', '.' => '_ ', '\\' => '_ '])), [' ' => '']);
16
    }
17
}
18