@@ -12,9 +12,13 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | function array_get($array, $key, $default = null) |
| 14 | 14 | { |
| 15 | - if (is_null($key)) return $array; |
|
| 15 | + if (is_null($key)) { |
|
| 16 | + return $array; |
|
| 17 | + } |
|
| 16 | 18 | |
| 17 | - if (isset($array[$key])) return $array[$key]; |
|
| 19 | + if (isset($array[$key])) { |
|
| 20 | + return $array[$key]; |
|
| 21 | + } |
|
| 18 | 22 | |
| 19 | 23 | foreach (explode('.', $key) as $segment) |
| 20 | 24 | { |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | { |
| 36 | 36 | function snake_case($value, $delimiter = '_') |
| 37 | 37 | { |
| 38 | - $replace = '$1'.$delimiter.'$2'; |
|
| 39 | - return ctype_lower($value) ? $value : strtolower(preg_replace('/(.)([A-Z])/', $replace, $value)); |
|
| 38 | + $replace = '$1'.$delimiter.'$2'; |
|
| 39 | + return ctype_lower($value) ? $value : strtolower(preg_replace('/(.)([A-Z])/', $replace, $value)); |
|
| 40 | 40 | } |
| 41 | 41 | } |