Skip to content

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

@matteorebeschi

Description

@matteorebeschi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions