Helper::generateName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 6
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Bavix\Router;
4
5
class Helper
6
{
7
8
    /**
9
     * @param string $path
10
     *
11
     * @return string
12
     */
13
    public static function generateName(string $path): string
14
    {
15
        return \preg_replace(
16
            '~[^\w-]~',
17
            '_',
18
            $path
19
        );
20
    }
21
22
}
23