Naming::sanitazeClassName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of Symplify.
7
 * Copyright (c) 2016 Tomas Votruba (http://tomasvotruba.cz).
8
 */
9
10
namespace Symplify\NetteAdapterForSymfonyBundles\Utils;
11
12
use Nette\Utils\Strings;
13
14
final class Naming
15
{
16 6
    public static function sanitazeClassName(string $name) : string
17
    {
18 6
        $name = Strings::webalize($name, '.');
19 6
        $name = strtr($name, ['-' => '_']);
20
21 6
        return $name;
22
    }
23
}
24