Completed
Pull Request — master (#413)
by Anton
14:05
created

Line   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 14
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 Line
20
{
21
    /**
22
     * Convert string to camel case
23
     *
24
     * @param  string $subject
25
     * @return string
26
     */
27
    public static function toCamelCase($subject) : string
28
    {
29
        $subject = str_replace(['_', '-'], ' ', strtolower($subject));
30
        return str_replace(' ', '', ucwords($subject));
31
    }
32
}
33