Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
53 | public function cacheFlagUnCamelCaseFilter(?string $value = null): string |
||
54 | { |
||
55 | if (empty($value)) { |
||
56 | return ''; |
||
57 | } |
||
58 | if (preg_match('/[A-Z]/', $value) === 0) { |
||
59 | return $value; |
||
60 | } |
||
61 | $pattern = '/([a-z])([A-Z])/'; |
||
62 | $r = strtolower(preg_replace_callback($pattern, function ($a) { |
||
63 | return $a[1] . ' ' . strtolower($a[2]); |
||
64 | }, $value)); |
||
65 | return $r; |
||
66 | } |
||
68 |