Completed
Pull Request — master (#413)
by Anton
06:02
created

Line::toCamelCase()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
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 738
    public static function toCamelCase($subject) : string
28
    {
29 738
        $subject = str_replace(['_', '-'], ' ', strtolower($subject));
30 738
        return str_replace(' ', '', ucwords($subject));
31
    }
32
}
33