Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | public static function tableize(string $word): string |
||
11 | { |
||
12 | $tableized = preg_replace('~(?<=\\w)([A-Z])~u', '_$1', $word); |
||
13 | |||
14 | if (null === $tableized) { |
||
15 | throw new \RuntimeException(sprintf('preg_replace returned null for value "%s"', $word)); |
||
16 | } |
||
17 | |||
18 | return mb_strtolower($tableized); |
||
19 | } |
||
21 |