Modern method reference syntax.

This commit is contained in:
flash 2024-05-22 20:35:43 +00:00
parent ed0fc15227
commit 0a56450c38

View file

@ -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 {