Skip to content

Commit

Permalink
Updates the routes.php file to remove deprecation warnings (#37)
Browse files Browse the repository at this point in the history
* Removes Cake\Routing\Router::plugin() deprecation

Replaced the Router class with RouterBuilder as it became deprecated in CakePHP version 4.3

* Updated CakePHP version
  • Loading branch information
Andream98 authored Jan 19, 2022
1 parent 6bd6511 commit 6e0a3fd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
20 changes: 10 additions & 10 deletions config/routes.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
use Cake\Routing\RouteBuilder;
use Cake\Routing\Router;
use Cake\Routing\Route\DashedRoute;

Router::plugin(
'AssetMix',
['path' => '/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);
});

0 comments on commit 6e0a3fd

Please sign in to comment.