Skip to content

Commit 6e61bbc

Browse files
remove call to missing help function, use class str directly instead
1 parent 4eb703c commit 6e61bbc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Controller.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use WP_REST_Request;
88
use WP_Error;
99
use Illuminate\Support\Collection;
10+
use Illuminate\Support\Str;
1011
use function App\template;
1112
use function App\locate_template;
1213

@@ -152,7 +153,7 @@ public static function getPath() : string
152153

153154
protected function getTemplate() : string
154155
{
155-
$action_kebab_case = kebab_case(camel_case($this->action));
156+
$action_kebab_case = Str::kebab(Str::camel($this->action));
156157

157158
// Default template path is always ajax/ followed by the action in kebab case.
158159
// If the action is "class based" this path will be considered the fallback path
@@ -180,7 +181,7 @@ protected function getTemplate() : string
180181

181182
protected static function getActionClass(string $action): string
182183
{
183-
return '\App\AjaxHandler\\' . studly_case($action);
184+
return '\App\AjaxHandler\\' . Str::studly($action);
184185
}
185186

186187
protected static function getActionClassMethod(): string
@@ -195,7 +196,7 @@ protected static function getAjaxClass(): string
195196

196197
protected static function getAjaxClassMethod(string $action): string
197198
{
198-
return camel_case($action);
199+
return Str::camel($action);
199200
}
200201

201202
protected static function hasClassBasedHandler(string $action, WP_REST_Request $request): bool

0 commit comments

Comments
 (0)