From b258f5c1d17ce94e85b6cc20dc6ce5b576060ef9 Mon Sep 17 00:00:00 2001 From: CWAscend <134165900+CWAscend@users.noreply.github.com> Date: Thu, 17 Oct 2024 23:42:38 +0100 Subject: [PATCH] Change method name for resolving action classes in routes --- src/Routing/ActionResourceRegistrar.php | 4 ++-- tests/ResourcefulRouteRegistrarTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Routing/ActionResourceRegistrar.php b/src/Routing/ActionResourceRegistrar.php index 3b7462c..af6b4b2 100644 --- a/src/Routing/ActionResourceRegistrar.php +++ b/src/Routing/ActionResourceRegistrar.php @@ -45,7 +45,7 @@ protected function getResourceAction($resource, $controller, $method, $options): * * @example * - * ActionResourceRegistrar::resolveResourcefulActionsUsing( + * ActionResourceRegistrar::resolveActionClassNameUsing( * function ($resource, $method): ?string { * return ucfirst($method) * .ucfirst(Str::camel(str_replace('.', '-', $resource))) @@ -56,7 +56,7 @@ protected function getResourceAction($resource, $controller, $method, $options): * @param Closure $resolver * @return void */ - public static function resolveResourcefulActionsUsing(Closure $resolver): void + public static function resolveActionClassNameUsing(Closure $resolver): void { static::$actionResolver = $resolver; } diff --git a/tests/ResourcefulRouteRegistrarTest.php b/tests/ResourcefulRouteRegistrarTest.php index 92a6e4e..36c37f7 100644 --- a/tests/ResourcefulRouteRegistrarTest.php +++ b/tests/ResourcefulRouteRegistrarTest.php @@ -291,7 +291,7 @@ }); it('allows you to customise the name of each action class, but falls back to the default behaviour if unresolved', function () { - ActionResourceRegistrar::resolveResourcefulActionsUsing(function (string $resource, string $method) { + ActionResourceRegistrar::resolveActionClassNameUsing(function (string $resource, string $method) { return match ($method) { 'index' => 'ShowIndexPage', 'create' => 'ShowCreatePage',