Conditions | 1 |
Paths | 1 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
9 | 2 | public static function convertClassNameToServiceName(string $className): string |
|
10 | { |
||
11 | 2 | $className = str_replace('\\', '.', $className); |
|
12 | |||
13 | 2 | $serviceName = lcfirst($className); |
|
14 | 2 | $serviceName = preg_replace('/([A-Z])/', '_$1', $serviceName); |
|
15 | |||
16 | 2 | $serviceName = str_replace('._', '.', $serviceName); |
|
17 | 2 | return strtolower($serviceName); |
|
18 | } |
||
19 | |||
33 |