Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
14 | 132 | public static function normalize(string $name): string |
|
15 | { |
||
16 | 132 | if (\array_key_exists($name, self::$specialSnowflakes)) { |
|
17 | 2 | return self::$specialSnowflakes[$name]; |
|
18 | } |
||
19 | |||
20 | 132 | $normalized = \strtolower($name); |
|
21 | |||
22 | 132 | if (0 === \strpos($normalized, 'http_')) { |
|
23 | 2 | $normalized = \str_replace('_', '-', \substr($normalized, 5)); |
|
24 | } |
||
25 | |||
26 | 132 | return $normalized; |
|
27 | } |
||
29 |