Skip to content
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

CakePHP 4.3: Router::plugin() is deprecated, use the non-static method RouteBuilder::plugin() instead #59

Open
matteorebeschi opened this issue May 10, 2022 · 1 comment

Comments

@matteorebeschi
Copy link

I recently updated my project to CakePHP 4.3, and I get this message:

[Deprecated (16384)](javascript:void(0);): `Router::plugin()` is deprecated, use the non-static method `RouteBuilder::plugin()` instead.
/var/www/repo/public/vendor/alt3/cakephp-swagger/config/routes.php, line: 56
You can disable all deprecation warnings by setting `Error.errorLevel` to `E_ALL & ~E_USER_DEPRECATED`. Adding `vendor/alt3/cakephp-swagger/config/routes.php` to `Error.ignoredDeprecationPaths` in your `config/app.php` config will mute deprecations from that file only. [CORE/src/Core/functions.php, line 321]

I think the fix is quite easy (I've done it in my project already), Router::plugin() just needs to be changed to $routes->plugin() in config/routes.php.

If needed, I can open a pull request for that.

@matteorebeschi
Copy link
Author

I have just opened the pull request #60 with the needed update to config/routes.php and composer.json.
It would be great if it could be merged and tagged, so that we can have a stable version of the package that is compatible with CakePHP 4.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant