CakePHP 4.3: Router::plugin() is deprecated, use the non-static method RouteBuilder::plugin() instead
matteorebeschi opened this issue · 1 comments
matteorebeschi commented
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 commented
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.