From 81e79eec04809a35146783cb7ed8dab4e2e3f9f6 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Wed, 25 Mar 2026 15:34:24 +0100 Subject: [PATCH] Zotlabs\Extend\Route: Add type annotations Make the code safer by adding type annotations for parameters and return values. --- Zotlabs/Extend/Route.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Zotlabs/Extend/Route.php b/Zotlabs/Extend/Route.php index a704850c5..b458df0dc 100644 --- a/Zotlabs/Extend/Route.php +++ b/Zotlabs/Extend/Route.php @@ -65,7 +65,7 @@ class Route { * @see {@link Zotlabs::Extend::Route.unregister() unregister()} * @see {@link Zotlabs::Extend::Route.unregister_by_file() unregister_by_file()} */ - public static function register($file,$modname) { + public static function register(string $file, string $modname): void { $rt = self::get(); foreach ($rt as $r) { @@ -95,7 +95,7 @@ class Route { * @see {@link Zotlabs::Extend::Route.register() register()} * @see {@link Zotlabs::Extend::Route.unregister_by_file() unregister_by_file()} */ - public static function unregister($file,$modname) { + public static function unregister(string $file, string $modname): void { $rt = self::get(); if($rt) { $n = []; @@ -124,7 +124,7 @@ class Route { * @see {@link Zotlabs::Extend::Route.register() register()} * @see {@link Zotlabs::Extend::Route.unregister() unregister()} */ - public static function unregister_by_file($file) { + public static function unregister_by_file(string $file): void { $rt = self::get(); if($rt) { $n = []; @@ -144,11 +144,11 @@ class Route { * containing two elements, the file, and the module * name. */ - public static function get() { + public static function get(): array { return Config::Get('system','routes',[]); } - private static function set($r) { + private static function set(array $r): mixed { return Config::Set('system','routes',$r); } }