-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: warning in Routes.php #3369
Comments
$routes->group('/', [ $routes->resource('users'); }); put that in controller folder.. and use name space in ur controller |
I took the example from the CI User Guide. My application works fine, I just wanted to report the warning given by PhpStorm. |
@gmeister2 I made the PR for the docblock changes of RouterCollection and did not know that PhpStorm resolves docblocks that way. I am using VSCode as my IDE and no warnings were generated using your example. Can you try using |
Yes, this solves it for me. |
OK, I'll PR that. |
Thanks! |
Describe the bug
When using the group function in Routes.php, example:
$routes->group('api', ['namespace' => 'App\API\v1'], function($routes)
{
$routes->resource('users');
});
PhpStorm gives the following warning:
Expected parameter of type 'array|array[]', 'Closure' provided
CodeIgniter 4 version
CI 4.04
Affected module(s)
app\Config\Routes.php
Expected behavior, and steps to reproduce if appropriate
CI 4.03 did not show this warning, because of difference in DocBlock of 'group' function in:
vendor\codeigniter4\framework\system\Router\RouteCollection.php
The text was updated successfully, but these errors were encountered: