You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior, and steps to reproduce if appropriate
Set CodeIgniter environment to development
Rename index method to _remap in app/Controllers/Home.php
run
You get method not exists error.
The following statement in system\Debug\Toolbar\Collectors\Routes.php:
$method = is_callable($router->controllerName()) ? new \ReflectionFunction($router->controllerName()) : new \ReflectionMethod($router->controllerName(), $router->methodName());
Calling \ReflectionMethod($router->controllerName(), $router->methodName()) without method_exists check
causes method not exists error.
Fix
$method = is_callable($router->controllerName()) ? new \ReflectionFunction($router->controllerName()) : new \ReflectionMethod($router->controllerName(), method_exists($router->controllerName(), '_remap') ? '_remap' : $router->methodName());
The text was updated successfully, but these errors were encountered:
Unable to reproduce this specific problem.
Applying the proposed solution breaks ControllerTesterTest, which expects an index() method.
The user guide says that index() is the default method, hence it seems reasonable that not having it, whether or not you have a _remap(), would cause problems.
Describe the bug
A controller with method other than _remap
creates error in routes toolbar collector.
CodeIgniter 4 version
CodeIgniter4 Beta 0.0.2
Affected module(s)
system\Debug\Toolbar\Collectors\Routes.php
Expected behavior, and steps to reproduce if appropriate
You get method not exists error.
The following statement in system\Debug\Toolbar\Collectors\Routes.php:
Calling \ReflectionMethod($router->controllerName(), $router->methodName()) without method_exists check
causes method not exists error.
Fix
The text was updated successfully, but these errors were encountered: