Completed
Pull Request — master (#435)
by Anton
04:35
created

Str   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
dl 0
loc 15
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A toCamelCase() 0 5 1
1
<?php
2
/**
3
 * Bluz Framework Component
4
 *
5
 * @copyright Bluz PHP Team
6
 * @link      https://github.com/bluzphp/framework
7
 */
8
9
declare(strict_types=1);
10
11
namespace Bluz\Common;
12
13
/**
14
 * Line is string :)
15
 *
16
 * @package  Bluz\Common
17
 * @author   Anton Shevchuk
18
 */
19
class Str
20
{
21
    /**
22
     * Convert string to CamelCase
23
     *
24
     * @param  string $subject
25
     *
26
     * @return string
27
     */
28 561
    public static function toCamelCase($subject): string
29
    {
30 561
        $subject = str_replace(['_', '-'], ' ', strtolower($subject));
31 561
        return str_replace(' ', '', ucwords($subject));
32
    }
33
}
34