Browse Source

fixed snake case conversion

develop
Robin Thoni 8 years ago
parent
commit
9ca0c8b696
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      src/Utils/Business/LuStringUtils.php

+ 2
- 2
src/Utils/Business/LuStringUtils.php View File

14
 {
14
 {
15
     public static function snakeToCamelCase($string, $capitalizeFirstCharacter)
15
     public static function snakeToCamelCase($string, $capitalizeFirstCharacter)
16
     {
16
     {
17
-        $str = preg_replace_callback("/_[a-zA-Z]/", function($matches)
17
+        $str = preg_replace_callback("/_[a-zA-Z0-9]/", function($matches)
18
         {
18
         {
19
             return strtoupper($matches[0][1]);
19
             return strtoupper($matches[0][1]);
20
         }, $string);
20
         }, $string);
26
     
26
     
27
     public static function camelCaseToSnake($string, $underscoreFirstCharacter)
27
     public static function camelCaseToSnake($string, $underscoreFirstCharacter)
28
     {
28
     {
29
-        $str = preg_replace_callback("/[A-Z]/", function($matches)
29
+        $str = preg_replace_callback("/[A-Z0-9]/", function($matches)
30
         {
30
         {
31
             return strtolower("_" . $matches[0]);
31
             return strtolower("_" . $matches[0]);
32
         }, $string);
32
         }, $string);

Loading…
Cancel
Save