From 6e0a3fdd0fe55eb5a59ca9284602b51336f0d390 Mon Sep 17 00:00:00 2001 From: Andrea Martella <52160332+Andream98@users.noreply.github.com> Date: Wed, 19 Jan 2022 17:22:21 +0100 Subject: [PATCH] Updates the routes.php file to remove deprecation warnings (#37) * Removes Cake\Routing\Router::plugin() deprecation Replaced the Router class with RouterBuilder as it became deprecated in CakePHP version 4.3 * Updated CakePHP version --- composer.json | 2 +- config/routes.php | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/composer.json b/composer.json index f06d634..97d5f80 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "require": { "ext-json": "*", "ext-mbstring": "*", - "cakephp/cakephp": "^4.0.0" + "cakephp/cakephp": "^4.3.0" }, "require-dev": { "cakephp/cakephp-codesniffer": "^4.2.0", diff --git a/config/routes.php b/config/routes.php index e8bb6e3..ad2d5b1 100644 --- a/config/routes.php +++ b/config/routes.php @@ -1,12 +1,12 @@ '/asset-mix'], - function (RouteBuilder $routes) { - $routes->fallbacks(DashedRoute::class); - } -); + use Cake\Routing\Route\DashedRoute; + use Cake\Routing\RouteBuilder; + + /** @var RouteBuilder $routes */ + $routes->plugin( + 'AssetMix', + ['path' => '/asset-mix'], + function (RouteBuilder $routes) { + $routes->fallbacks(DashedRoute::class); + });