From 0a56450c38dab0da383a6b698193c64e00eda8fd Mon Sep 17 00:00:00 2001 From: flashwave Date: Wed, 22 May 2024 20:35:43 +0000 Subject: [PATCH] Modern method reference syntax. --- src/RedirectorRoutes.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/RedirectorRoutes.php b/src/RedirectorRoutes.php index 61542ce..edaecab 100644 --- a/src/RedirectorRoutes.php +++ b/src/RedirectorRoutes.php @@ -13,24 +13,24 @@ final class RedirectorRoutes { $this->dbConn = $dbConn; $this->urls = $urls; - $router->get('/', [$this, 'index']); + $router->get('/', $this->index(...)); // profile - $router->get('/[up]([0-9]+)', [$this, 'redirectProfile']); - $router->get('/[up]/([A-Za-z0-9\-_]+)', [$this, 'redirectProfile']); + $router->get('/[up]([0-9]+)', $this->redirectProfile(...)); + $router->get('/[up]/([A-Za-z0-9\-_]+)', $this->redirectProfile(...)); // forum categories - $router->get('/f/?([0-9]+)', [$this, 'redirectForumCategory']); - $router->get('/fc/?([0-9]+)', [$this, 'redirectForumCategory']); + $router->get('/f/?([0-9]+)', $this->redirectForumCategory(...)); + $router->get('/fc/?([0-9]+)', $this->redirectForumCategory(...)); // forum topic - $router->get('/ft/?([0-9]+)', [$this, 'redirectForumTopic']); + $router->get('/ft/?([0-9]+)', $this->redirectForumTopic(...)); // forum post - $router->get('/fp/?([0-9]+)', [$this, 'redirectForumPost']); + $router->get('/fp/?([0-9]+)', $this->redirectForumPost(...)); // databased, registered last cuz it matches everything otherwise! - $router->get('/([A-Za-z0-9\-_]+)', [$this, 'redirectDatabase']); + $router->get('/([A-Za-z0-9\-_]+)', $this->redirectDatabase(...)); } public function index($response): void {