We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 72ad9a3 commit 1ae6c4eCopy full SHA for 1ae6c4e
Services/Twilio/Resource.php
@@ -71,8 +71,9 @@ public function getResourceName($camelized = false)
71
72
public static function decamelize($word)
73
{
74
- $callback = create_function('$matches',
75
- 'return strtolower(strlen("$matches[1]") ? "$matches[1]_$matches[2]" : "$matches[2]");');
+ $callback = function($m) {
+ return strtolower(strlen($m[1]) ? "$m[1]_$m[2]" : $m[2]);
76
+ };
77
78
return preg_replace_callback(
79
'/(^|[a-z])([A-Z])/',
@@ -90,7 +91,9 @@ public static function decamelize($word)
90
91
* @return string
92
*/
93
public static function camelize($word) {
- $callback = create_function('$matches', 'return strtoupper("$matches[2]");');
94
95
+ return strtoupper($m[2]);
96
97
98
return preg_replace_callback('/(^|_)([a-z])/',
99
$callback,
0 commit comments