`Router::scope()` is deprecated, use the non-static method `RouteBuilder::scope()` instead

Hi, I’m seeing this error after migrating to 4.4.7, but have absolutely no idea what I do about it. The relevant bit of code in routes.php is shown below. I have commented out the reference to a galleries controller as I no longer have this controller. Can someone point me in the right direction please?

Router::scope(‘/’, function (RouteBuilder $routes) {

/**
 * Apply a middleware to the current route scope.
 * Requires middleware to be registered via `Application::routes()` with `registerMiddleware()`
 */

// $routes->applyMiddleware(‘csrf’);

/**
 * Here, we are connecting '/' (base path) to a controller called 'Pages',
 * its action called 'display', and we pass a param to select the view file
 * to use (in this case, src/Template/Pages/home.ctp)...
 */
$routes->connect('/', ['controller' => 'Pages', 'action' => 'display', 'index']);

/Router::connect('/gallery/',
array(‘controller’ => ‘galleries’, ‘action’=>‘index’)); */

/**
 * ...and connect the rest of 'Pages' controller's URLs.
 */
$routes->connect('/pages/*', ['controller' => 'Pages', 'action' => 'display']);

/**
 * Connect catchall routes for all controllers.
 *
 * Using the argument `DashedRoute`, the `fallbacks` method is a shortcut for
 *
 * ```
 * $routes->connect('/:controller', ['action' => 'index'], ['routeClass' => 'DashedRoute']);
 * $routes->connect('/:controller/:action/*', [], ['routeClass' => 'DashedRoute']);
 * ```
 *
 * Any route class can be used with this method, such as:
 * - DashedRoute
 * - InflectedRoute
 * - Route
 * - Or your own route class
 *
 * You can remove these routes once you've connected the
 * routes you want in your application.
 */
$routes->fallbacks(DashedRoute::class);

});

See app/routes.php at 4.x · cakephp/app · GitHub

Magic! Fixed it, thank you.